1
0
Fork 0
mirror of https://github.com/pnx/lualine-lsp-status synced 2026-06-16 01:54:57 +02:00

add support for "always" value for show_count

This commit is contained in:
Henrik Hautakoski 2024-09-06 17:18:29 +02:00
parent 8054e5a716
commit 1218d51d4d
2 changed files with 15 additions and 4 deletions

View file

@ -50,8 +50,13 @@ This is the default configuration, feel free to change it to your liking.
```lua
{
-- true if the number of lsp clients connected should be shown.
-- Control how/when client count should be displayed
--
-- The following values are accepted:
--
-- * true : Count is displayed if its greater than zero
-- * false : No count is displayed.
-- * "always" : Count is displayed regardless of value.
show_count = true,
-- true if icon should also be color coded.

View file

@ -3,7 +3,13 @@ local utils = require('lualine.utils.utils')
local default_options = {
-- true if the number of lsp clients connected should be shown.
-- Control how/when client count should be displayed
--
-- The following values are accepted:
--
-- * true : Count is displayed if its greater than zero
-- * false : No count is displayed.
-- * "always" : Count is displayed regardless of value.
show_count = true,
-- true if icon should also be color coded.
@ -96,7 +102,7 @@ function M:update_status()
table.insert(segments, icon)
end
if self.options.show_count then
if self.options.show_count and (num_clients > 0 or self.options.show_count == "always") then
if self.options.colored then
table.insert(segments, self.hl["count"] .. num_clients)
else