diff --git a/README.md b/README.md index 9bd1f68..5973b50 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lua/lualine/components/lsp-status.lua b/lua/lualine/components/lsp-status.lua index 8dcde50..2a8298d 100644 --- a/lua/lualine/components/lsp-status.lua +++ b/lua/lualine/components/lsp-status.lua @@ -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