1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:00:04 +08:00

perf(statusline): support quickfix & loclist

This commit is contained in:
Eric Wong 2024-06-12 19:29:50 +08:00
parent 921d96cb10
commit 6b653dbf86

View File

@ -505,7 +505,24 @@ local special_statusline = {
vimfiler = function()
return simple_name('VimFiler')
end,
qf = function() end, -- todo
qf = function()
local l = ''
local wininfo = vim.fn.getwininfo(vim.api.nvim_get_current_win())[1]
if wininfo.quickfix == 1 and wininfo.loclist == 0 then
local title = vim.fn.getqflist({ title = 0 }).title
if title == ':setqflist()' then
title = ''
end
l = simple_name('QuickFix') .. ' ' .. title
elseif wininfo.loclist == 1 then
local title = vim.fn.getloclist(vim.fn.winnr(), { title = 0 }).title
if title == ':setloclist()' then
title = ''
end
l = simple_name('Location list') .. ' ' .. title
end
return l
end,
defx = function()
return simple_name('defx')
end,
@ -645,12 +662,10 @@ local special_statusline = {
return simple_name('HelpDescribe')
end,
SpaceVimRunner = function()
return simple_name('Runner') .. ' %{SpaceVim#plugins#runner#status()}'
return simple_name('Runner') .. ' %{SpaceVim#plugins#runner#status()}'
end,
SpaceVimREPL = function()
return simple_name('REPL') .. ' %{SpaceVim#plugins#repl#status()}'
return simple_name('REPL') .. ' %{SpaceVim#plugins#repl#status()}'
end,
VimMailClient = function() end, -- todo
SpaceVimQuickFix = function()