diff options
| author | Volodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com> | 2026-09-02 23:01:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-02 17:01:54 -0400 |
| commit | 0ecca23ee2449304f138090eee5e15d512d1cceb (patch) | |
| tree | 928253f53ee75d5988855345fd53632b8205a564 /runtime/lua/vim/treesitter/dev.lua | |
| parent | a58cee4512a12688099a569c2e1c11ec6c1c608b (diff) | |
| download | rneovim-0ecca23ee2449304f138090eee5e15d512d1cceb.tar.gz rneovim-0ecca23ee2449304f138090eee5e15d512d1cceb.tar.bz2 rneovim-0ecca23ee2449304f138090eee5e15d512d1cceb.zip | |
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.
Diffstat (limited to 'runtime/lua/vim/treesitter/dev.lua')
| -rw-r--r-- | runtime/lua/vim/treesitter/dev.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua index 32cd13ae3d..0eaff2e554 100644 --- a/runtime/lua/vim/treesitter/dev.lua +++ b/runtime/lua/vim/treesitter/dev.lua @@ -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') |