diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /src/nvim/buffer_updates.c | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.gz rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.bz2 rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'src/nvim/buffer_updates.c')
-rw-r--r-- | src/nvim/buffer_updates.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index 075ac2adbf..01bcb9d7be 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -1,28 +1,25 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include <inttypes.h> +#include <lauxlib.h> #include <stdbool.h> #include <stddef.h> #include "klib/kvec.h" -#include "lauxlib.h" #include "nvim/api/buffer.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/assert.h" +#include "nvim/assert_defs.h" #include "nvim/buffer.h" #include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" -#include "nvim/extmark.h" +#include "nvim/func_attr.h" #include "nvim/globals.h" #include "nvim/log.h" #include "nvim/lua/executor.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/msgpack_rpc/channel.h" -#include "nvim/pos.h" -#include "nvim/types.h" +#include "nvim/pos_defs.h" +#include "nvim/types_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "buffer_updates.c.generated.h" // IWYU pragma: export @@ -188,9 +185,9 @@ void buf_updates_unload(buf_T *buf, bool can_reload) // the first argument is always the buffer handle args.items[0] = BUFFER_OBJ(buf->handle); - textlock++; - nlua_call_ref(thecb, keep ? "reload" : "detach", args, false, NULL); - textlock--; + TEXTLOCK_WRAP({ + nlua_call_ref(thecb, keep ? "reload" : "detach", args, false, NULL); + }); } if (keep) { @@ -305,9 +302,11 @@ void buf_updates_send_changes(buf_T *buf, linenr_T firstline, int64_t num_added, args.items[6] = INTEGER_OBJ((Integer)deleted_codepoints); args.items[7] = INTEGER_OBJ((Integer)deleted_codeunits); } - textlock++; - Object res = nlua_call_ref(cb.on_lines, "lines", args, false, NULL); - textlock--; + + Object res; + TEXTLOCK_WRAP({ + res = nlua_call_ref(cb.on_lines, "lines", args, false, NULL); + }); if (res.type == kObjectTypeBoolean && res.data.boolean == true) { buffer_update_callbacks_free(cb); @@ -354,9 +353,10 @@ void buf_updates_send_splice(buf_T *buf, int start_row, colnr_T start_col, bcoun ADD_C(args, INTEGER_OBJ(new_col)); ADD_C(args, INTEGER_OBJ(new_byte)); - textlock++; - Object res = nlua_call_ref(cb.on_bytes, "bytes", args, false, NULL); - textlock--; + Object res; + TEXTLOCK_WRAP({ + res = nlua_call_ref(cb.on_bytes, "bytes", args, false, NULL); + }); if (res.type == kObjectTypeBoolean && res.data.boolean == true) { buffer_update_callbacks_free(cb); @@ -389,10 +389,10 @@ void buf_updates_changedtick(buf_T *buf) // next argument is b:changedtick ADD_C(args, INTEGER_OBJ(buf_get_changedtick(buf))); - textlock++; - Object res = nlua_call_ref(cb.on_changedtick, "changedtick", - args, false, NULL); - textlock--; + Object res; + TEXTLOCK_WRAP({ + res = nlua_call_ref(cb.on_changedtick, "changedtick", args, false, NULL); + }); if (res.type == kObjectTypeBoolean && res.data.boolean == true) { buffer_update_callbacks_free(cb); |