From 15153c4cd5319652bcdcd608fe5d4f0fa1eb9419 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 17 Dec 2024 09:03:26 +0800 Subject: vim-patch:9.1.0938: exclusive selection not respected when re-selecting block mode (#31603) Problem: exclusive selection not respected when re-selecting block mode (Matt Ellis) Solution: advance selection by another character when using selection=exclusive and visual block mode fixes: vim/vim#16202 closes: vim/vim#16219 https://github.com/vim/vim/commit/bb955894734b287abfadd3a25786a42038d18d61 Co-authored-by: Christian Brabandt --- src/nvim/normal.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 4d2abf1c8c..a664535c0f 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -5038,6 +5038,9 @@ static void nv_visual(cmdarg_T *cap) assert(cap->count0 >= INT_MIN && cap->count0 <= INT_MAX); curwin->w_curswant += resel_VIsual_vcol * cap->count0 - 1; curwin->w_cursor.lnum = lnum; + if (*p_sel == 'e') { + curwin->w_curswant++; + } coladvance(curwin, curwin->w_curswant); } else { curwin->w_set_curswant = true; -- cgit