fix(ui): trouble lualine component
This commit is contained in:
@@ -47,6 +47,7 @@ vim.g.deprecation_warnings = false
|
||||
vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB
|
||||
|
||||
-- Show the current document symbols location from Trouble in lualine
|
||||
-- You can disable this for a buffer by setting `vim.b.trouble_lualine = false`
|
||||
vim.g.trouble_lualine = true
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
@@ -199,14 +199,9 @@ return {
|
||||
|
||||
-- do not add trouble symbols if aerial is enabled
|
||||
-- And allow it to be overriden for some buffer types (see autocmds)
|
||||
if
|
||||
vim.g.trouble_lualine_enabled ~= false
|
||||
and vim.b.trouble_lualine_enabled ~= false
|
||||
and LazyVim.has("trouble.nvim")
|
||||
then
|
||||
if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then
|
||||
local trouble = require("trouble")
|
||||
local symbols = trouble.statusline
|
||||
and trouble.statusline({
|
||||
local symbols = trouble.statusline({
|
||||
mode = "symbols",
|
||||
groups = {},
|
||||
title = false,
|
||||
@@ -216,7 +211,9 @@ return {
|
||||
})
|
||||
table.insert(opts.sections.lualine_c, {
|
||||
symbols and symbols.get,
|
||||
cond = symbols and symbols.has,
|
||||
cond = function()
|
||||
return vim.b.trouble_lualine ~= false and symbols.has()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user