mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
flush curbuf->deleted_bytes2 after calling do_move
This commit is contained in:
@@ -968,12 +968,6 @@ int do_move(linenr_T line1, linenr_T line2, linenr_T dest)
|
||||
mark_adjust_nofold(last_line - num_lines + 1, last_line,
|
||||
-(last_line - dest - extra), 0L, kExtmarkNOOP);
|
||||
|
||||
// extmarks are handled separately
|
||||
extmark_move_region(curbuf, line1-1, 0, start_byte,
|
||||
line2-line1+1, 0, extent_byte,
|
||||
dest+line_off, 0, dest_byte+byte_off,
|
||||
kExtmarkUndo);
|
||||
|
||||
changed_lines(last_line - num_lines + 1, 0, last_line + 1, -extra, false);
|
||||
|
||||
// send update regarding the new lines that were added
|
||||
@@ -995,6 +989,11 @@ int do_move(linenr_T line1, linenr_T line2, linenr_T dest)
|
||||
smsg(_("%" PRId64 " lines moved"), (int64_t)num_lines);
|
||||
}
|
||||
|
||||
extmark_move_region(curbuf, line1-1, 0, start_byte,
|
||||
line2-line1+1, 0, extent_byte,
|
||||
dest+line_off, 0, dest_byte+byte_off,
|
||||
kExtmarkUndo);
|
||||
|
||||
/*
|
||||
* Leave the cursor on the last of the moved lines.
|
||||
*/
|
||||
|
@@ -702,6 +702,7 @@ void extmark_move_region(
|
||||
int new_row, colnr_T new_col, bcount_t new_byte,
|
||||
ExtmarkOp undo)
|
||||
{
|
||||
curbuf->deleted_bytes2 = 0;
|
||||
// TODO(bfredl): this is not synced to the buffer state inside the callback.
|
||||
// But unless we make the undo implementation smarter, this is not ensured
|
||||
// anyway.
|
||||
|
Reference in New Issue
Block a user