diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-23 07:27:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 07:27:26 +0800 |
commit | a7e0a02031c7b4a192cb9c0e4eb13a714d5b0dbb (patch) | |
tree | 39fa589222180be4e84c6aa4dfe4cb00d2c90e21 /src/nvim/eval.c | |
parent | 39fb97b2a5bb7ecd69cd7955fba045f7b002df6d (diff) | |
parent | bcfc97e8d85df38ce7bea16c02cf8f89c9c96cdc (diff) | |
download | rneovim-a7e0a02031c7b4a192cb9c0e4eb13a714d5b0dbb.tar.gz rneovim-a7e0a02031c7b4a192cb9c0e4eb13a714d5b0dbb.tar.bz2 rneovim-a7e0a02031c7b4a192cb9c0e4eb13a714d5b0dbb.zip |
Merge pull request #18691 from zeertzjq/vim-8.2.4996
vim-patch:8.2.{4996.5002}: setbufline(), deletebufline() may change Visual selection
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 641dcae55e..33080c145d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6886,6 +6886,7 @@ void set_buffer_lines(buf_T *buf, linenr_T lnum_arg, bool append, const typval_T buf_T *curbuf_save = NULL; win_T *curwin_save = NULL; const bool is_curbuf = buf == curbuf; + const bool save_VIsual_active = VIsual_active; // When using the current buffer ml_mfp will be set if needed. Useful when // setline() is used on startup. For other buffers the buffer must be @@ -6896,6 +6897,7 @@ void set_buffer_lines(buf_T *buf, linenr_T lnum_arg, bool append, const typval_T } if (!is_curbuf) { + VIsual_active = false; curbuf_save = curbuf; curwin_save = curwin; curbuf = buf; @@ -6986,6 +6988,7 @@ void set_buffer_lines(buf_T *buf, linenr_T lnum_arg, bool append, const typval_T if (!is_curbuf) { curbuf = curbuf_save; curwin = curwin_save; + VIsual_active = save_VIsual_active; } } |