0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.4785: Visual mode not stopped if win_gotoid() goes to other buffer

Problem:    Visual mode not stopped early enough if win_gotoid() goes to
            another buffer. (Sergey Vlasov)
Solution:   Stop Visual mode before jumping to another buffer. (closes #10217)
This commit is contained in:
Bram Moolenaar
2022-04-18 18:32:19 +01:00
parent 1693712f02
commit 3aca0916f0
6 changed files with 91 additions and 0 deletions

View File

@@ -817,6 +817,9 @@ f_win_gotoid(typval_T *argvars, typval_T *rettv)
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_id == id)
{
// When jumping to another buffer stop Visual mode.
if (VIsual_active && wp->w_buffer != curbuf)
end_visual_mode();
goto_tabpage_win(tp, wp);
rettv->vval.v_number = 1;
return;