mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
vim-patch:8.2.3540: the mark '] is wrong after put with a count
Problem: The mark '] is wrong after put with a count. (Naohiro Ono)
Solution: Use the right line number. (closes vim/vim#8956)
f47ebf1e1a
This commit is contained in:
@@ -3591,7 +3591,7 @@ error:
|
|||||||
|
|
||||||
// Put the '] mark on the first byte of the last inserted character.
|
// Put the '] mark on the first byte of the last inserted character.
|
||||||
// Correct the length for change in indent.
|
// Correct the length for change in indent.
|
||||||
curbuf->b_op_end.lnum = lnum;
|
curbuf->b_op_end.lnum = new_lnum;
|
||||||
col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff;
|
col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff;
|
||||||
if (col > 1) {
|
if (col > 1) {
|
||||||
curbuf->b_op_end.col = col - 1 - utf_head_off(y_array[y_size - 1],
|
curbuf->b_op_end.col = col - 1 - utf_head_off(y_array[y_size - 1],
|
||||||
|
@@ -126,6 +126,18 @@ func Test_gp_with_count_leaves_cursor_at_end()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_p_with_count_leaves_mark_at_end()
|
||||||
|
new
|
||||||
|
call setline(1, '<---->')
|
||||||
|
call setreg('@', "start\nend", 'c')
|
||||||
|
normal 1G3|3p
|
||||||
|
call assert_equal([0, 1, 4, 0], getpos("."))
|
||||||
|
call assert_equal(['<--start', 'endstart', 'endstart', 'end-->'], getline(1, '$'))
|
||||||
|
call assert_equal([0, 4, 3, 0], getpos("']"))
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_multibyte_op_end_mark()
|
func Test_multibyte_op_end_mark()
|
||||||
new
|
new
|
||||||
call setline(1, 'тест')
|
call setline(1, 'тест')
|
||||||
|
Reference in New Issue
Block a user