fix(lualine): only show one Lualine component for symbols (#3514)

Fixes #3511
This commit is contained in:
Iordanis Petkakis
2024-06-07 13:12:05 +03:00
committed by GitHub
parent 119dcb949a
commit 827aa5380a
2 changed files with 29 additions and 25 deletions

View File

@ -104,27 +104,29 @@ return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
optional = true, optional = true,
opts = function(_, opts) opts = function(_, opts)
table.insert(opts.sections.lualine_c, { if not vim.g.trouble_lualine then
"aerial", table.insert(opts.sections.lualine_c, {
sep = " ", -- separator between symbols "aerial",
sep_icon = "", -- separator between icon and symbol sep = " ", -- separator between symbols
sep_icon = "", -- separator between icon and symbol
-- The number of symbols to render top-down. In order to render only 'N' last -- The number of symbols to render top-down. In order to render only 'N' last
-- symbols, negative numbers may be supplied. For instance, 'depth = -1' can -- symbols, negative numbers may be supplied. For instance, 'depth = -1' can
-- be used in order to render only current symbol. -- be used in order to render only current symbol.
depth = 5, depth = 5,
-- When 'dense' mode is on, icons are not rendered near their symbols. Only -- When 'dense' mode is on, icons are not rendered near their symbols. Only
-- a single icon that represents the kind of current symbol is rendered at -- a single icon that represents the kind of current symbol is rendered at
-- the beginning of status line. -- the beginning of status line.
dense = false, dense = false,
-- The separator to be used to separate symbols in dense mode. -- The separator to be used to separate symbols in dense mode.
dense_sep = ".", dense_sep = ".",
-- Color the symbol icons. -- Color the symbol icons.
colored = true, colored = true,
}) })
end
end, end,
}, },
} }

View File

@ -29,14 +29,16 @@ return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
optional = true, optional = true,
opts = function(_, opts) opts = function(_, opts)
table.insert(opts.sections.lualine_c, { if not vim.g.trouble_lualine then
function() table.insert(opts.sections.lualine_c, {
return require("nvim-navic").get_location() function()
end, return require("nvim-navic").get_location()
cond = function() end,
return package.loaded["nvim-navic"] and require("nvim-navic").is_available() cond = function()
end, return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
}) end,
})
end
end, end,
}, },
} }