]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0699: "dvgo" is not always an inclusive motion v9.1.0699
authorChristian Brabandt <cb@256bit.org>
Wed, 28 Aug 2024 18:39:24 +0000 (20:39 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 28 Aug 2024 18:39:24 +0000 (20:39 +0200)
Problem:  "dvgo" is not always an inclusive motion
          (Iain King-Speir)
Solution: initialize the inclusive flag to false

fixes: #15580
closes: #15582

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/motion.txt
src/normal.c
src/testdir/test_normal.vim
src/version.c

index 3e45884be9bf2cccf5857e07c572a39bf4e20ca0..62947c0af1a8884226b619bf642b42056437d318 100644 (file)
@@ -1,4 +1,4 @@
-*motion.txt*    For Vim version 9.1.  Last change: 2024 Jul 14
+*motion.txt*    For Vim version 9.1.  Last change: 2024 Aug 28
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -364,11 +364,11 @@ gg                        Goto line [count], default first line, on the first
                        See also 'startofline' option.
 
 :[range]go[to] [count]                                 *:go* *:goto* *go*
-[count]go              Go to [count] byte in the buffer.  Default [count] is
-                       one, start of the file.  When giving [range], the
-                       last number in it used as the byte count.  End-of-line
-                       characters are counted depending on the current
-                       'fileformat' setting.
+[count]go              Go to [count] byte in the buffer.  |exclusive| motion.
+                       Default [count] is one, start of the file.  When
+                       giving [range], the last number in it used as the byte
+                       count.  End-of-line characters are counted depending
+                       on the current 'fileformat' setting.
                        Also see the |line2byte()| function, and the 'o'
                        option in 'statusline'.
                        {not available when compiled without the
index a929dd8082d95496033e55dc5b7f8d8fd5cb21ad..b0540050ad003bd7be5e5ce42969f65c2edf0316 100644 (file)
@@ -6227,6 +6227,7 @@ nv_g_cmd(cmdarg_T *cap)
 #ifdef FEAT_BYTEOFF
     // "go": goto byte count from start of buffer
     case 'o':
+       oap->inclusive = FALSE;
        goto_byte(cap->count0);
        break;
 #endif
index 398bf2992f9a233012469d101463dbd153901b7b..adb5ce725dcba4d98f5ca87c7f97e00162edcddb 100644 (file)
@@ -4281,4 +4281,17 @@ func Test_scroll_longline_no_loop()
   exe "normal! \<C-E>"
   bwipe!
 endfunc
+
+" Test for go command
+func Test_normal_go()
+  new
+  call setline(1, ['one two three four'])
+  call cursor(1, 5)
+  norm! dvgo
+  call assert_equal('wo three four', getline(1))
+  norm! ...
+  call assert_equal('three four', getline(1))
+
+  bwipe!
+endfunc
 " vim: shiftwidth=2 sts=2 expandtab nofoldenable
index 314a3207a88c448a60aad719713fb123b9555cb1..100a1ae7007d1969f8c0b57613c37a961bc1f905 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    699,
 /**/
     698,
 /**/