nvim: statusline: Fix tree-sitter status
Fixing based on file type was not good enough. Check for error return and act accordingly.
This commit is contained in:
parent
ac3039d64b
commit
6bf989871e
1 changed files with 8 additions and 9 deletions
|
@ -171,16 +171,15 @@ M.progress = function()
|
|||
end
|
||||
|
||||
M.treesitter_status = function()
|
||||
local filetype = vim.bo.filetype
|
||||
local ignore_ft = { 'diff', 'fugitive', 'git', 'markdown', 'qf', 'text', '' }
|
||||
for _, v in pairs(ignore_ft) do
|
||||
if v == filetype then
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
if gps.is_available then
|
||||
return string.format("%s%s", ' %#TSStatus#', gps.get_location())
|
||||
local location = gps.get_location()
|
||||
if location == 'error' then
|
||||
return ''
|
||||
else
|
||||
return string.format("%s%s", ' %#TSStatus#', location)
|
||||
end
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue