nvim: statusline: Handle some more cases for filename & treesitter status
This commit is contained in:
parent
7d70992eae
commit
9c16443e10
1 changed files with 15 additions and 5 deletions
|
@ -122,12 +122,14 @@ end
|
||||||
|
|
||||||
M.get_filename = function(self)
|
M.get_filename = function(self)
|
||||||
local filetype = vim.bo.filetype
|
local filetype = vim.bo.filetype
|
||||||
|
local special_ft = { 'diff', 'fugitive', 'git', 'qf' }
|
||||||
if filetype == "qf" then
|
for _, v in pairs(special_ft) do
|
||||||
return string.format(" %s%s", "%#Filename#", "QF")
|
if v == filetype then
|
||||||
else
|
return string.format(" %s%s", "%#Filename#", filetype)
|
||||||
return string.format(" %s%s", "%#Filename#", '%t%m%r')
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return string.format(" %s%s", "%#Filename#", '%t%m%r')
|
||||||
end
|
end
|
||||||
|
|
||||||
M.get_fileformat = function()
|
M.get_fileformat = function()
|
||||||
|
@ -169,6 +171,14 @@ M.progress = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
M.treesitter_status = function()
|
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
|
if gps.is_available then
|
||||||
return string.format("%s%s", ' %#TSStatus#', gps.get_location())
|
return string.format("%s%s", ' %#TSStatus#', gps.get_location())
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue