mirror of
https://github.com/pnx/lualine-lsp-status
synced 2026-07-02 12:53:40 +02:00
adding disabled_filetypes option.
This commit is contained in:
parent
69651df246
commit
8054e5a716
2 changed files with 10 additions and 0 deletions
|
|
@ -57,6 +57,9 @@ This is the default configuration, feel free to change it to your liking.
|
|||
-- true if icon should also be color coded.
|
||||
colored = true,
|
||||
|
||||
-- List of filetypes to disable this component for.
|
||||
disabled_filetypes = {},
|
||||
|
||||
-- Colors used.
|
||||
colors = {
|
||||
-- Color used if there are one or more clients connected
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ local default_options = {
|
|||
-- true if icon should also be color coded.
|
||||
colored = true,
|
||||
|
||||
-- List of filetypes to disable this component for.
|
||||
disabled_filetypes = {},
|
||||
|
||||
-- Colors used.
|
||||
colors = {
|
||||
-- Color used if there are one or more clients connected
|
||||
|
|
@ -74,6 +77,10 @@ end
|
|||
|
||||
function M:update_status()
|
||||
|
||||
if vim.tbl_contains(self.options.disabled_filetypes or {}, vim.bo.filetype) then
|
||||
return ""
|
||||
end
|
||||
|
||||
local num_clients = #vim.tbl_keys(vim.lsp.get_clients({bufnr = 0}))
|
||||
local status = "inactive"
|
||||
if num_clients > 0 then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue