diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-12-15 22:18:35 +0100 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-12-15 22:29:27 +0100 |
commit | 25e20da550b0d267013ac295756bad76f5fda7ef (patch) | |
tree | 6678ef7dae44dbc9419a25b5159cb1215554ab3b /src/nvim/buffer_updates.c | |
parent | d0112693a3f442a6638114f1a9ef896a0bc5960b (diff) | |
download | rneovim-25e20da550b0d267013ac295756bad76f5fda7ef.tar.gz rneovim-25e20da550b0d267013ac295756bad76f5fda7ef.tar.bz2 rneovim-25e20da550b0d267013ac295756bad76f5fda7ef.zip |
feat(buffer_updates): allow ignoring when previewing
Also adds a test that we actually subscribe to buffer events when in
CMDPREVIEW.
Diffstat (limited to 'src/nvim/buffer_updates.c')
-rw-r--r-- | src/nvim/buffer_updates.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index fc671ad9e2..68e123896b 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -237,7 +237,7 @@ void buf_updates_send_changes(buf_T *buf, for (size_t i = 0; i < kv_size(buf->update_callbacks); i++) { BufUpdateCallbacks cb = kv_A(buf->update_callbacks, i); bool keep = true; - if (cb.on_lines != LUA_NOREF) { + if (cb.on_lines != LUA_NOREF && (cb.preview || !(State & CMDPREVIEW))) { Array args = ARRAY_DICT_INIT; Object items[8]; args.size = 6; // may be increased to 8 below @@ -298,7 +298,7 @@ void buf_updates_send_splice( for (size_t i = 0; i < kv_size(buf->update_callbacks); i++) { BufUpdateCallbacks cb = kv_A(buf->update_callbacks, i); bool keep = true; - if (cb.on_bytes != LUA_NOREF) { + if (cb.on_bytes != LUA_NOREF && (cb.preview || !(State & CMDPREVIEW))) { FIXED_TEMP_ARRAY(args, 11); // the first argument is always the buffer handle |