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
This commit is contained in:
Luuk van Baal
2023-11-18 23:49:11 +01:00
parent 34fa1e1ca4
commit c249058758
5 changed files with 35 additions and 17 deletions

View File

@@ -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()