mirror of
https://github.com/neovim/neovim.git
synced 2026-07-15 22:00:40 +00:00
fix(marks): skip right_gravity marks when deleting text
Problem: Marks that are properly restored by the splice associated with
an undo edit, are unnecessarily pushed to the undo header. This
results in incorrect mark tracking in the "copy_only"
save/restore completion path.
Solution: Avoid pushing left gravity marks at the beginning of the range,
and right gravity marks at the end of the range to the undo
header.
(cherry picked from commit c4f76299f0)
This commit is contained in:
committed by
github-actions[bot]
parent
7abc58349e
commit
01fe4fc589
@@ -249,7 +249,7 @@ describe('API/extmarks', function()
|
||||
set_extmark(ns, 2, 1, 0, { right_gravity = false })
|
||||
eq({ { 1, 0, 0 }, { 2, 1, 0 } }, get_extmarks(ns, { 0, 0 }, { -1, -1 }))
|
||||
feed('u')
|
||||
eq({ { 1, 0, 0 }, { 2, 1, 0 } }, get_extmarks(ns, { 0, 0 }, { -1, -1 }))
|
||||
eq({ { 1, 0, 0 }, { 2, 0, 0 } }, get_extmarks(ns, { 0, 0 }, { -1, -1 }))
|
||||
api.nvim_buf_clear_namespace(0, ns, 0, -1)
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user