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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user