mirror of
https://github.com/neovim/neovim.git
synced 2026-04-19 22:10:45 +00:00
fix(treesitter): :InspectTree wrong title for non-relative path #37965
Problem: :InspectTree sets wrong title for file with non-relative path. Solution: Use full path if relpath() returns nil.
This commit is contained in:
@@ -378,7 +378,7 @@ function M.inspect_tree(opts)
|
||||
local opts_title = opts.title
|
||||
if not opts_title then
|
||||
local bufname = api.nvim_buf_get_name(buf)
|
||||
title = ('Syntax tree for %s'):format(vim.fs.relpath('.', bufname))
|
||||
title = ('Syntax tree for %s'):format(vim.fs.relpath('.', bufname) or bufname)
|
||||
elseif type(opts_title) == 'function' then
|
||||
title = opts_title(buf)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user