]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1464: gv does not work in operator-pending mode v9.1.1464
authorphanium <91544758+phanen@users.noreply.github.com>
Mon, 16 Jun 2025 18:19:15 +0000 (20:19 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 16 Jun 2025 18:19:15 +0000 (20:19 +0200)
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 <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/version9.txt
src/normal.c
src/testdir/test_normal.vim
src/version.c

index ec963aea776f418af3ff096e1a5f01b5be251a98..cd72d73310136ba020408428c99f155e620c92e1 100644 (file)
@@ -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 ~
index c631651a03e40c65aff8894a9206b42571999bb6..8758d4b75dadb2834f16095e4619d601624e9c17 100644 (file)
@@ -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)
index 069651f6bcbabde322494b611f57ca50f0e40166..cbd90ec4e7e49a869e922e75c2819408753d4336 100644 (file)
@@ -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')
index 8d4cbf25533fcbc8200d94eb830e9442e19216e0..65199ad6d4cc9113e3230c91f76a41d1b38274c1 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1464,
 /**/
     1463,
 /**/