mirror of
https://github.com/neovim/neovim
synced 2025-07-16 17:21:49 +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.
(cherry picked from commit b52ffd0a59
)
This commit is contained in:
committed by
github-actions[bot]
parent
6a63034b51
commit
650dcbbafe
@ -184,9 +184,11 @@ function vim.show_pos(bufnr, row, col, filter)
|
||||
for _, capture in ipairs(items.treesitter) do
|
||||
item(
|
||||
capture,
|
||||
capture.metadata.priority
|
||||
and string.format('%s priority: %d', capture.lang, capture.metadata.priority)
|
||||
or capture.lang
|
||||
string.format(
|
||||
'priority: %d language: %s',
|
||||
capture.metadata.priority or vim.hl.priorities.treesitter,
|
||||
capture.lang
|
||||
)
|
||||
)
|
||||
end
|
||||
nl()
|
||||
|
Reference in New Issue
Block a user