Commit: patch 9.1.0699: "dvgo" is not always an inclusive motion

5 views
Skip to first unread message

Christian Brabandt

unread,
Aug 28, 2024, 2:45:15 PM8/28/24
to vim...@googlegroups.com
patch 9.1.0699: "dvgo" is not always an inclusive motion

Commit: https://github.com/vim/vim/commit/f8702aeb8ff85554d909901ae45b50c3d532bf70
Author: Christian Brabandt <c...@256bit.org>
Date: Wed Aug 28 20:39:24 2024 +0200

patch 9.1.0699: "dvgo" is not always an inclusive motion

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 <c...@256bit.org>

diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index 3e45884be..62947c0af 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -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
diff --git a/src/normal.c b/src/normal.c
index a929dd808..b0540050a 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -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
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 398bf2992..adb5ce725 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index 314a3207a..100a1ae70 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

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