mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3455: using a count with "gp" leaves '] in wrong position
Problem: Using a count with "gp" leaves '] in wrong position. (Naohiro Ono)
Solution: Correct the mark position. (closes vim/vim#8899)
56858e4ed4
This commit is contained in:
parent
fee7d6fba4
commit
7812c6830c
@ -3616,6 +3616,10 @@ error:
|
|||||||
} else {
|
} else {
|
||||||
curwin->w_cursor.lnum = new_lnum;
|
curwin->w_cursor.lnum = new_lnum;
|
||||||
curwin->w_cursor.col = col;
|
curwin->w_cursor.col = col;
|
||||||
|
curbuf->b_op_end = curwin->w_cursor;
|
||||||
|
if (col > 1) {
|
||||||
|
curbuf->b_op_end.col = col - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (y_type == kMTLineWise) {
|
} else if (y_type == kMTLineWise) {
|
||||||
// put cursor on first non-blank in first inserted line
|
// put cursor on first non-blank in first inserted line
|
||||||
|
@ -116,8 +116,10 @@ func Test_gp_with_count_leaves_cursor_at_end()
|
|||||||
new
|
new
|
||||||
call setline(1, '<---->')
|
call setline(1, '<---->')
|
||||||
call setreg('@', "foo\nbar", 'c')
|
call setreg('@', "foo\nbar", 'c')
|
||||||
exe "normal 1G3|3gpix\<Esc>"
|
normal 1G3|3gp
|
||||||
call assert_equal(['<--foo', 'barfoo', 'barfoo', 'barx-->'], getline(1, '$'))
|
call assert_equal([0, 4, 4, 0], getpos("."))
|
||||||
|
call assert_equal(['<--foo', 'barfoo', 'barfoo', 'bar-->'], getline(1, '$'))
|
||||||
|
call assert_equal([0, 4, 3, 0], getpos("']"))
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
Loading…
Reference in New Issue
Block a user