From 9c278af7cc96e5b7f07cd9fdec27951651063a76 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 6 Dec 2024 19:18:03 +0100 Subject: [PATCH] fix(inspect): show priority for treesitter highlights Problem: `:Inspect` does not show priority for treesitter highlights, leading to confusion why sometimes earlier highlights override later highlights. Solution: Also print priority metadata if set. --- runtime/lua/vim/_inspector.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/lua/vim/_inspector.lua b/runtime/lua/vim/_inspector.lua index f4e41a31e5..520c437906 100644 --- a/runtime/lua/vim/_inspector.lua +++ b/runtime/lua/vim/_inspector.lua @@ -191,7 +191,12 @@ function vim.show_pos(bufnr, row, col, filter) append('Treesitter', 'Title') nl() for _, capture in ipairs(items.treesitter) do - item(capture, capture.lang) + item( + capture, + capture.metadata.priority + and string.format('%s priority: %d', capture.lang, capture.metadata.priority) + or capture.lang + ) end nl() end