mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 13:27:43 +00:00
fix(treesitter): display fields for anonymous nodes in :InspectTree
(cherry picked from commit 9217e0d671)
This commit is contained in:
committed by
Christian Clason
parent
5cad641848
commit
ab2d243fd0
@@ -220,14 +220,13 @@ function TSTreeView:draw(bufnr)
|
||||
|
||||
local text ---@type string
|
||||
if item.node:named() then
|
||||
if item.field then
|
||||
text = string.format('%s: (%s', item.field, item.node:type())
|
||||
else
|
||||
text = string.format('(%s', item.node:type())
|
||||
end
|
||||
text = string.format('(%s', item.node:type())
|
||||
else
|
||||
text = string.format('%q', item.node:type()):gsub('\n', 'n')
|
||||
end
|
||||
if item.field then
|
||||
text = string.format('%s: %s', item.field, text)
|
||||
end
|
||||
|
||||
local next = self:get(i + 1)
|
||||
if not next or next.depth <= item.depth then
|
||||
|
||||
Reference in New Issue
Block a user