diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-06-30 13:26:31 +0600 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-08-31 20:40:17 +0200 |
commit | f31db30975479cb6b57247f124a65f4362f80bfe (patch) | |
tree | 772b9942c04459e3d7fd3a523c2a400978e0edb5 /src/nvim/buffer_updates.c | |
parent | 0903702634d8e5714749ea599a2f1042b3377525 (diff) | |
download | rneovim-f31db30975479cb6b57247f124a65f4362f80bfe.tar.gz rneovim-f31db30975479cb6b57247f124a65f4362f80bfe.tar.bz2 rneovim-f31db30975479cb6b57247f124a65f4362f80bfe.zip |
feat(lua): vim.ui_attach to get ui events from lua
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
Diffstat (limited to 'src/nvim/buffer_updates.c')
-rw-r--r-- | src/nvim/buffer_updates.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index 14973502ab..1b3c0bc28f 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -285,14 +285,13 @@ void buf_updates_send_changes(buf_T *buf, linenr_T firstline, int64_t num_added, args.items[7] = INTEGER_OBJ((Integer)deleted_codeunits); } textlock++; - Object res = nlua_call_ref(cb.on_lines, "lines", args, true, NULL); + Object res = nlua_call_ref(cb.on_lines, "lines", args, false, NULL); textlock--; if (res.type == kObjectTypeBoolean && res.data.boolean == true) { buffer_update_callbacks_free(cb); keep = false; } - api_free_object(res); } if (keep) { kv_A(buf->update_callbacks, j++) = kv_A(buf->update_callbacks, i); @@ -335,7 +334,7 @@ void buf_updates_send_splice(buf_T *buf, int start_row, colnr_T start_col, bcoun ADD_C(args, INTEGER_OBJ(new_byte)); textlock++; - Object res = nlua_call_ref(cb.on_bytes, "bytes", args, true, NULL); + Object res = nlua_call_ref(cb.on_bytes, "bytes", args, false, NULL); textlock--; if (res.type == kObjectTypeBoolean && res.data.boolean == true) { @@ -371,14 +370,13 @@ void buf_updates_changedtick(buf_T *buf) textlock++; Object res = nlua_call_ref(cb.on_changedtick, "changedtick", - args, true, NULL); + args, false, NULL); textlock--; if (res.type == kObjectTypeBoolean && res.data.boolean == true) { buffer_update_callbacks_free(cb); keep = false; } - api_free_object(res); } if (keep) { kv_A(buf->update_callbacks, j++) = kv_A(buf->update_callbacks, i); |