diff options
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | vis-lua.c | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -594,6 +594,7 @@ At this time there exists no API stability guarantees. - `name` - `lines[0..#lines+1]` array giving read/write access to lines - `newlines` type of newlines either `"nl"` or `"crnl"` + - `size` current file size in bytes - `window` - `file` - `syntax` lexer name used for syntax highlighting or `nil` @@ -657,6 +657,11 @@ static int file_index(lua_State *L) { } return 1; } + + if (strcmp(key, "size") == 0) { + lua_pushunsigned(L, text_size(file->text)); + return 1; + } } return index_common(L); |
