neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit a979a6237e6367373e88ab204bfa0f8c4725285a
parent 033f1123cd9132d211bca874fc9f42b9e50e122e
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Mon, 22 Dec 2025 20:31:07 +0800

vim-patch:8.2.4785: Visual mode not stopped if win_gotoid() goes to other buffer (#37073)

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 vim/vim#10217)

https://github.com/vim/vim/commit/3aca0916f0dba6114ae0f7d5458763a934fe7a02

Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat:
Msrc/nvim/eval/window.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/nvim/eval/window.c b/src/nvim/eval/window.c @@ -25,6 +25,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/move.h" +#include "nvim/normal.h" #include "nvim/option_vars.h" #include "nvim/os/fs.h" #include "nvim/pos_defs.h" @@ -608,6 +609,10 @@ void f_win_gotoid(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) } FOR_ALL_TAB_WINDOWS(tp, wp) { if (wp->handle == 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;