From c4f76299f0398f8a9b42bb7c1a5fad3205680298 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Fri, 6 Dec 2024 11:13:58 +0100 Subject: 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. --- test/functional/api/extmark_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/api') diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua index 43be0c0e43..49c55288e8 100644 --- a/test/functional/api/extmark_spec.lua +++ b/test/functional/api/extmark_spec.lua @@ -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) -- cgit