From c249058758af6919f718750b2f4acb96bafeb2dd Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 18 Nov 2023 23:49:11 +0100 Subject: feat(extmarks): add sign name to extmark "details" array Problem: Unable to identify legacy signs when fetching extmarks with `nvim_buf_get_extmarks()`. Solution: Add "sign_name" to the extmark detail array. Add some misc. changes as follow-up to #25724 --- test/functional/api/extmark_spec.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua index 2115c7c244..44a151cf6a 100644 --- a/test/functional/api/extmark_spec.lua +++ b/test/functional/api/extmark_spec.lua @@ -1582,6 +1582,23 @@ describe('API/extmarks', function() priority = 4096, right_gravity = true, } }, get_extmark_by_id(ns, marks[3], { details = true })) + curbufmeths.clear_namespace(ns, 0, -1) + -- legacy sign mark includes sign name + command('sign define sign1 text=s1 texthl=Title linehl=LineNR numhl=Normal culhl=CursorLine') + command('sign place 1 name=sign1 line=1') + eq({ {1, 0, 0, { + cursorline_hl_group = 'CursorLine', + invalidate = true, + line_hl_group = 'LineNr', + ns_id = 0, + number_hl_group = 'Normal', + priority = 10, + right_gravity = true, + sign_hl_group = 'Title', + sign_name = 'sign1', + sign_text = 's1', + undo_restore = false + } } }, get_extmarks(-1, 0, -1, { details = true })) end) it('can get marks from anonymous namespaces', function() -- cgit