mirror of
https://github.com/neovim/neovim.git
synced 2026-03-21 16:09:42 +00:00
fix(treesitter): display fields for anonymous nodes in :InspectTree
This commit is contained in:
committed by
Christian Clason
parent
2a883d9c59
commit
9217e0d671
@@ -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