diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-22 11:59:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-22 11:59:25 +0100 |
commit | 0ad00a7fd3e0389f565876521e395c35144d8009 (patch) | |
tree | 521ecf9cc1dd52b5d3f5703b1014cb06b33154f3 /src/evalbuffer.c | |
parent | dafef51b1cbe8aa836c4cfa52623f775bd85a190 (diff) |
patch 8.2.4996: setbufline() may change Visual selectionv8.2.4996
Problem: setbufline() may change Visual selection. (Qiming Zhao)
Solution: Disable Visual mode when using another buffer. (closes #10466)
Diffstat (limited to 'src/evalbuffer.c')
-rw-r--r-- | src/evalbuffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/evalbuffer.c b/src/evalbuffer.c index 1b829848fb..13f813ebd8 100644 --- a/src/evalbuffer.c +++ b/src/evalbuffer.c @@ -144,6 +144,7 @@ set_buffer_lines( buf_T *curbuf_save = NULL; win_T *curwin_save = NULL; int is_curbuf = buf == curbuf; + int 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 @@ -158,6 +159,7 @@ set_buffer_lines( if (!is_curbuf) { + VIsual_active = FALSE; curbuf_save = curbuf; curwin_save = curwin; curbuf = buf; @@ -264,6 +266,7 @@ done: { curbuf = curbuf_save; curwin = curwin_save; + VIsual_active = save_VIsual_active; } } |