0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.5002: deletebufline() may change Visual selection

Problem:    deletebufline() may change Visual selection.
Solution:   Disable Visual mode when using another buffer. (closes #10469)
This commit is contained in:
LemonBoy
2022-05-22 15:35:53 +01:00
committed by Bram Moolenaar
parent 8a3704723c
commit 9b2edfd3bf
3 changed files with 22 additions and 0 deletions

View File

@@ -510,6 +510,7 @@ f_deletebufline(typval_T *argvars, typval_T *rettv)
tabpage_T *tp;
win_T *wp;
int did_emsg_before = did_emsg;
int save_VIsual_active = VIsual_active;
rettv->vval.v_number = 1; // FAIL by default
@@ -538,6 +539,7 @@ f_deletebufline(typval_T *argvars, typval_T *rettv)
if (!is_curbuf)
{
VIsual_active = FALSE;
curbuf_save = curbuf;
curwin_save = curwin;
curbuf = buf;
@@ -582,6 +584,7 @@ f_deletebufline(typval_T *argvars, typval_T *rettv)
{
curbuf = curbuf_save;
curwin = curwin_save;
VIsual_active = save_VIsual_active;
}
rettv->vval.v_number = 0; // OK
}