mirror of
https://github.com/neovim/neovim.git
synced 2026-09-03 21:00:34 +00:00
fix(treesitter): accept a string title in inspect_tree() #41639
Problem: `inspect_tree()` documents `title` as `string|fun(bufnr:integer):string|nil`, but the implementation handles only `nil` and function values. A string title leaves `title` unset and fails the assertion below. Solution: Use the string as the title.
This commit is contained in:
committed by
GitHub
parent
a58cee4512
commit
0ecca23ee2
@@ -391,6 +391,8 @@ function M.inspect_tree(opts)
|
||||
title = ('Syntax tree for %s'):format(vim.fs.relpath('.', bufname) or bufname)
|
||||
elseif type(opts_title) == 'function' then
|
||||
title = opts_title(buf)
|
||||
else
|
||||
title = opts_title
|
||||
end
|
||||
|
||||
assert(type(title) == 'string', 'Window title must be a string')
|
||||
|
||||
Reference in New Issue
Block a user