Commit: patch 9.1.1464: gv does not work in operator-pending mode

1 view
Skip to first unread message

Christian Brabandt

unread,
Jun 16, 2025, 2:30:12 PMJun 16
to vim...@googlegroups.com
patch 9.1.1464: gv does not work in operator-pending mode

Commit: https://github.com/vim/vim/commit/cb27992cdadd3a17a9094096f0972fa806f0240d
Author: phanium <9154475...@users.noreply.github.com>
Date: Mon Jun 16 20:19:15 2025 +0200

patch 9.1.1464: gv does not work in operator-pending mode

Problem: gv does not work in operator-pending mode
(liushapku)
Solution: remove the check for checkclearop in nv_gv_cmd()
(phanium)

fixes: #3666
closes: #17551

Signed-off-by: phanium <9154475...@users.noreply.github.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index ec963aea7..cd72d7331 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt* For Vim version 9.1. Last change: 2025 May 28
+*version9.txt* For Vim version 9.1. Last change: 2025 Jun 16


VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41686,6 +41686,7 @@ Others: ~
- |CTRL-C| always closes the active |popup-window|.
- the configure script will favor using GTK3 over GTK2 when auto-detecting the
gui toolkit
+- |gv| works in operator pending mode and does not abort

*added-9.2*
Added ~
diff --git a/src/normal.c b/src/normal.c
index c631651a0..8758d4b75 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -5676,9 +5676,6 @@ nv_gv_cmd(cmdarg_T *cap)
pos_T tpos;
int i;

- if (checkclearop(cap->oap))
- return;
-
if (curbuf->b_visual.vi_start.lnum == 0
|| curbuf->b_visual.vi_start.lnum > curbuf->b_ml.ml_line_count
|| curbuf->b_visual.vi_end.lnum == 0)
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 069651f6b..cbd90ec4e 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -2604,8 +2604,14 @@ func Test_normal33_g_cmd2()
exe "norm! G0\<c-v>4k4ly"
exe "norm! gvood"
call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'fgh', 'fgh', 'fgh', 'fgh', 'fgh'], getline(1,'$'))
- " gv cannot be used in operator pending mode
- call assert_beeps('normal! cgv')
+ " gv works in operator pending mode
+ call assert_nobeep('normal! cgvxyza')
+ call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'xyza', 'xyza', 'xyza', 'xyza', 'xyza'], getline(1,'$'))
+ exe "norm! ^\<c-v>Gydgv..cgvbc"
+ call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'bc', 'bc', 'bc', 'bc', 'bc'], getline(1,'$'))
+ exe "norm! v^GragggUgv"
+ call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'bA', 'AA', 'AA', 'AA', 'Ac'], getline(1,'$'))
+
" gv should beep without a previously selected visual area
new
call assert_beeps('normal! gv')
diff --git a/src/version.c b/src/version.c
index 8d4cbf255..65199ad6d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -709,6 +709,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1464,
/**/
1463,
/**/
Reply all
Reply to author
Forward
0 new messages