fix(ui): do not add trouble to lualine when aerial is enabled

This commit is contained in:
Sped0n 2024-05-31 10:04:50 +08:00
parent 060f56d6d4
commit f72ca7f5d3
No known key found for this signature in database
GPG key ID: BC705B4929716A2B

View file

@ -128,18 +128,7 @@ return {
vim.o.laststatus = vim.g.lualine_laststatus
local trouble = require("trouble")
local symbols = trouble.statusline
and trouble.statusline({
mode = "symbols",
groups = {},
title = false,
filter = { range = true },
format = "{kind_icon}{symbol.name:Normal}",
hl_group = "lualine_c_normal",
})
return {
local opts = {
options = {
theme = "auto",
globalstatus = true,
@ -162,10 +151,6 @@ return {
},
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
{ LazyVim.lualine.pretty_path() },
{
symbols and symbols.get,
cond = symbols and symbols.has,
},
},
lualine_x = {
-- stylua: ignore
@ -222,6 +207,26 @@ return {
},
extensions = { "neo-tree", "lazy" },
}
-- do not add trouble symbols if aerial is enabled
if not LazyVim.has("aerial.nvim") then
local trouble = require("trouble")
local symbols = trouble.statusline
and trouble.statusline({
mode = "symbols",
groups = {},
title = false,
filter = { range = true },
format = "{kind_icon}{symbol.name:Normal}",
hl_group = "lualine_c_normal",
})
table.insert(opts.sections.lualine_c, {
symbols and symbols.get,
cond = symbols and symbols.has,
})
end
return opts
end,
},