mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
fix(extmarks): splice extmarks on nv_Undo #15920
This commit is contained in:
parent
d0c0878b3e
commit
e06936125a
@ -3085,6 +3085,8 @@ void u_undoline(void)
|
|||||||
oldp = u_save_line(curbuf->b_u_line_lnum);
|
oldp = u_save_line(curbuf->b_u_line_lnum);
|
||||||
ml_replace(curbuf->b_u_line_lnum, curbuf->b_u_line_ptr, true);
|
ml_replace(curbuf->b_u_line_lnum, curbuf->b_u_line_ptr, true);
|
||||||
changed_bytes(curbuf->b_u_line_lnum, 0);
|
changed_bytes(curbuf->b_u_line_lnum, 0);
|
||||||
|
extmark_splice_cols(curbuf, (int)curbuf->b_u_line_lnum-1, 0, (colnr_T)STRLEN(oldp),
|
||||||
|
(colnr_T)STRLEN(curbuf->b_u_line_ptr), kExtmarkUndo);
|
||||||
xfree(curbuf->b_u_line_ptr);
|
xfree(curbuf->b_u_line_ptr);
|
||||||
curbuf->b_u_line_ptr = oldp;
|
curbuf->b_u_line_ptr = oldp;
|
||||||
|
|
||||||
|
@ -1050,6 +1050,19 @@ describe('lua: nvim_buf_attach on_bytes', function()
|
|||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("sends updates on U", function()
|
||||||
|
feed("ggiAAA<cr>BBB")
|
||||||
|
feed("<esc>gg$a CCC")
|
||||||
|
|
||||||
|
local check_events = setup_eventcheck(verify, nil)
|
||||||
|
|
||||||
|
feed("ggU")
|
||||||
|
|
||||||
|
check_events {
|
||||||
|
{ "test1", "bytes", 1, 6, 0, 7, 7, 0, 0, 0, 0, 3, 3 };
|
||||||
|
}
|
||||||
|
end)
|
||||||
|
|
||||||
teardown(function()
|
teardown(function()
|
||||||
os.remove "Xtest-reload"
|
os.remove "Xtest-reload"
|
||||||
os.remove "Xtest-undofile"
|
os.remove "Xtest-undofile"
|
||||||
|
Loading…
Reference in New Issue
Block a user