Shadman 2f801ed622
Refactor: simplify options (#24)
* Deprecate upper & lower option.

These does not make much sense and `format` option can provide same results

* Unify padding options

* Add persistent notices

* Make separators use left/right keys to specify left right instead of
sequence

* Rename format -> fmt

* Rename condition -> cond

* Rename disable_text -> icon_only

* Unify color_error,warning,info,hint under diagnostics_color

* Unify color_added,modified,removed hint under diff_color
2021-09-14 21:14:23 +06:00

42 lines
781 B
Lua

-- Copyright (c) 2020-2021 hoob3rt
-- MIT license, see LICENSE for more details.
--
local function is_loclist()
return vim.fn.getloclist(0, { filewinid = 1 }).filewinid ~= 0
end
local function label()
return is_loclist() and 'Location List' or 'Quickfix List'
end
local function title()
if is_loclist() then
return vim.fn.getloclist(0, { title = 0 }).title
end
return vim.fn.getqflist({ title = 0 }).title
end
local empty = {
function()
return ' '
end,
padding = 0,
}
local M = {}
function M.init()
-- Make sure ft wf doesn't create a custom statusline
vim.g.qf_disable_statusline = true
end
M.sections = {
lualine_a = { label },
lualine_b = { title },
lualine_c = { empty },
lualine_z = { 'location' },
}
M.filetypes = { 'qf' }
return M