Skip to content

Commit f8702ae

Browse files
committed
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 <cb@256bit.org>
1 parent 8556e23 commit f8702ae

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

runtime/doc/motion.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*motion.txt* For Vim version 9.1. Last change: 2024 Jul 14
1+
*motion.txt* For Vim version 9.1. Last change: 2024 Aug 28
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -364,11 +364,11 @@ gg Goto line [count], default first line, on the first
364364
See also 'startofline' option.
365365

366366
:[range]go[to] [count] *:go* *:goto* *go*
367-
[count]go Go to [count] byte in the buffer. Default [count] is
368-
one, start of the file. When giving [range], the
369-
last number in it used as the byte count. End-of-line
370-
characters are counted depending on the current
371-
'fileformat' setting.
367+
[count]go Go to [count] byte in the buffer. |exclusive| motion.
368+
Default [count] is one, start of the file. When
369+
giving [range], the last number in it used as the byte
370+
count. End-of-line characters are counted depending
371+
on the current 'fileformat' setting.
372372
Also see the |line2byte()| function, and the 'o'
373373
option in 'statusline'.
374374
{not available when compiled without the

src/normal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6227,6 +6227,7 @@ nv_g_cmd(cmdarg_T *cap)
62276227
#ifdef FEAT_BYTEOFF
62286228
// "go": goto byte count from start of buffer
62296229
case 'o':
6230+
oap->inclusive = FALSE;
62306231
goto_byte(cap->count0);
62316232
break;
62326233
#endif

src/testdir/test_normal.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4281,4 +4281,17 @@ func Test_scroll_longline_no_loop()
42814281
exe "normal! \<C-E>"
42824282
bwipe!
42834283
endfunc
4284+
4285+
" Test for go command
4286+
func Test_normal_go()
4287+
new
4288+
call setline(1, ['one two three four'])
4289+
call cursor(1, 5)
4290+
norm! dvgo
4291+
call assert_equal('wo three four', getline(1))
4292+
norm! ...
4293+
call assert_equal('three four', getline(1))
4294+
4295+
bwipe!
4296+
endfunc
42844297
" vim: shiftwidth=2 sts=2 expandtab nofoldenable

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
699,
707709
/**/
708710
698,
709711
/**/

0 commit comments

Comments
 (0)