buffer updates: fix issues with "change" operator

This commit is contained in:
Björn Linse 2020-09-19 10:01:00 +02:00
parent 4cc2a7af4b
commit b7fc7ac6a1
2 changed files with 2 additions and 7 deletions

View File

@ -1553,10 +1553,6 @@ int op_delete(oparg_T *oap)
++curwin->w_cursor.lnum;
del_lines(oap->line_count - 1, TRUE);
curwin->w_cursor.lnum = lnum;
extmark_adjust(curbuf, curwin->w_cursor.lnum,
curwin->w_cursor.lnum + oap->line_count - 1,
MAXLNUM, 0, kExtmarkUndo);
}
if (u_save_cursor() == FAIL)
return FAIL;
@ -1571,7 +1567,7 @@ int op_delete(oparg_T *oap)
truncate_line(FALSE); // delete the rest of the line
extmark_splice_cols(curbuf,
(int)curwin->w_cursor.lnum, curwin->w_cursor.col,
(int)curwin->w_cursor.lnum-1, curwin->w_cursor.col,
old_len - curwin->w_cursor.col, 0, kExtmarkUndo);
// leave cursor past last char in line

View File

@ -427,7 +427,7 @@ describe('lua: nvim_buf_attach on_bytes', function()
feed "cc"
check_events {
{ "test1", "bytes", 1, 4, 1, 0, 1, 0, 15, 15, 0, 0, 0 };
{ "test1", "bytes", 1, 4, 0, 0, 0, 0, 15, 15, 0, 0, 0 };
}
feed "<ESC>"
@ -436,7 +436,6 @@ describe('lua: nvim_buf_attach on_bytes', function()
feed "c3j"
check_events {
{ "test1", "bytes", 1, 4, 1, 0, 1, 3, 0, 48, 0, 0, 0 };
{ "test1", "bytes", 1, 5, 0, 0, 0, 4, 0, 0, 4, 0, 51 };
}
end)
end