diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-25 08:48:59 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-26 08:41:17 +0200 |
| commit | 064f2d7ac6b9c9efb56ffba0fa4971619f95f022 (patch) | |
| tree | f8ea4e1266f72f4f142e09d7cd59dbab958ea779 | |
| parent | 205be8532390e588bef839edc0cea2cc36b096a7 (diff) | |
| download | vis-064f2d7ac6b9c9efb56ffba0fa4971619f95f022.tar.gz vis-064f2d7ac6b9c9efb56ffba0fa4971619f95f022.tar.xz | |
vis-lua: add file.modified property
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | vis-lua.c | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -607,6 +607,7 @@ At this time there exists no API stability guarantees. - `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 + - `modified` whether the file contains unsaved changes - `window` - `file` - `cursors_iterator()` @@ -822,6 +822,11 @@ static int file_index(lua_State *L) { lua_pushunsigned(L, text_size(file->text)); return 1; } + + if (strcmp(key, "modified") == 0) { + lua_pushboolean(L, text_modified(file->text)); + return 1; + } } return index_common(L); |
