mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +00:00
vim-patch:9.1.0699: "dvgo" is not always an inclusive motion (#30173)
Problem: "dvgo" is not always an inclusive motion (Iain King-Speir) Solution: initialize the inclusive flag to false fixes: vim/vim#15580 closes: vim/vim#15582f8702aeb8f
Co-authored-by: Christian Brabandt <cb@256bit.org> (cherry picked from commit0346666f71
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
f132efaefb
commit
3a50639331
@@ -354,11 +354,11 @@ gg Goto line [count], default first line, on the first
|
|||||||
See also 'startofline' option.
|
See also 'startofline' option.
|
||||||
|
|
||||||
:[range]go[to] [count] *:go* *:goto* *go*
|
:[range]go[to] [count] *:go* *:goto* *go*
|
||||||
[count]go Go to [count] byte in the buffer. Default [count] is
|
[count]go Go to [count] byte in the buffer. |exclusive| motion.
|
||||||
one, start of the file. When giving [range], the
|
Default [count] is one, start of the file. When
|
||||||
last number in it used as the byte count. End-of-line
|
giving [range], the last number in it used as the byte
|
||||||
characters are counted depending on the current
|
count. End-of-line characters are counted depending
|
||||||
'fileformat' setting.
|
on the current 'fileformat' setting.
|
||||||
Also see the |line2byte()| function, and the 'o'
|
Also see the |line2byte()| function, and the 'o'
|
||||||
option in 'statusline'.
|
option in 'statusline'.
|
||||||
|
|
||||||
|
@@ -5616,6 +5616,7 @@ static void nv_g_cmd(cmdarg_T *cap)
|
|||||||
|
|
||||||
// "go": goto byte count from start of buffer
|
// "go": goto byte count from start of buffer
|
||||||
case 'o':
|
case 'o':
|
||||||
|
oap->inclusive = false;
|
||||||
goto_byte(cap->count0);
|
goto_byte(cap->count0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -4291,4 +4291,17 @@ func Test_scroll_longline_no_loop()
|
|||||||
exe "normal! \<C-E>"
|
exe "normal! \<C-E>"
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
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
|
" vim: shiftwidth=2 sts=2 expandtab nofoldenable
|
||||||
|
Reference in New Issue
Block a user