summaryrefslogtreecommitdiffstats
path: root/src/evalwindow.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-04-18 18:32:19 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-18 18:32:19 +0100
commit3aca0916f0dba6114ae0f7d5458763a934fe7a02 (patch)
tree0cd7630487f8bf45e38e7a28495e1c86f16fe4b1 /src/evalwindow.c
parent1693712f0263afb929ebca1159ceb17c1563ee3b (diff)
patch 8.2.4785: Visual mode not stopped if win_gotoid() goes to other bufferv8.2.4785
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)
Diffstat (limited to 'src/evalwindow.c')
-rw-r--r--src/evalwindow.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/evalwindow.c b/src/evalwindow.c
index f6bc79f9e8..53fd1e3569 100644
--- a/src/evalwindow.c
+++ b/src/evalwindow.c
@@ -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;