mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 17:03:39 +02:00
fix(ui): allow to disable the trouble lualine component with vim.g.trouble_lualine = false
(#3391)
* fix(ui): do not add trouble to lualine when aerial is enabled * refactor: make trouble lualine an option --------- Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
parent
6678af37ee
commit
d02b73d72a
2 changed files with 24 additions and 16 deletions
|
@ -28,6 +28,9 @@ vim.g.lazygit_config = true
|
||||||
-- Hide deprecation warnings
|
-- Hide deprecation warnings
|
||||||
vim.g.deprecation_warnings = false
|
vim.g.deprecation_warnings = false
|
||||||
|
|
||||||
|
-- Show the current document symbols location from Trouble in lualine
|
||||||
|
vim.g.trouble_lualine = true
|
||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
opt.autowrite = true -- Enable auto write
|
opt.autowrite = true -- Enable auto write
|
||||||
|
|
|
@ -128,18 +128,7 @@ return {
|
||||||
|
|
||||||
vim.o.laststatus = vim.g.lualine_laststatus
|
vim.o.laststatus = vim.g.lualine_laststatus
|
||||||
|
|
||||||
local trouble = require("trouble")
|
local opts = {
|
||||||
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 {
|
|
||||||
options = {
|
options = {
|
||||||
theme = "auto",
|
theme = "auto",
|
||||||
globalstatus = true,
|
globalstatus = true,
|
||||||
|
@ -162,10 +151,6 @@ return {
|
||||||
},
|
},
|
||||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||||
{ LazyVim.lualine.pretty_path() },
|
{ LazyVim.lualine.pretty_path() },
|
||||||
{
|
|
||||||
symbols and symbols.get,
|
|
||||||
cond = symbols and symbols.has,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
|
@ -222,6 +207,26 @@ return {
|
||||||
},
|
},
|
||||||
extensions = { "neo-tree", "lazy" },
|
extensions = { "neo-tree", "lazy" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- do not add trouble symbols if aerial is enabled
|
||||||
|
if vim.g.trouble_lualine 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,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue