mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(inspect): always show priority
Problem: It is not obvious if a treesitter highlight priority shown in `:Inspect` is higher or lower than the default. Solution: Also print default priority (`vim.hl.priorities.treesitter`). Add padding for better readability.
This commit is contained in:

committed by
Christian Clason

parent
4817547ec4
commit
b52ffd0a59
@@ -193,9 +193,11 @@ function vim.show_pos(bufnr, row, col, filter)
|
|||||||
for _, capture in ipairs(items.treesitter) do
|
for _, capture in ipairs(items.treesitter) do
|
||||||
item(
|
item(
|
||||||
capture,
|
capture,
|
||||||
capture.metadata.priority
|
string.format(
|
||||||
and string.format('%s priority: %d', capture.lang, capture.metadata.priority)
|
'priority: %d language: %s',
|
||||||
or capture.lang
|
capture.metadata.priority or vim.hl.priorities.treesitter,
|
||||||
|
capture.lang
|
||||||
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
nl()
|
nl()
|
||||||
|
Reference in New Issue
Block a user