Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always add a space after status_symbol #41

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions lua/lsp-status/statusline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,26 @@ local function get_lsp_statusline(bufnr)
if #vim.lsp.buf_get_clients(bufnr) == 0 then return '' end
local buf_diagnostics = config.diagnostics and diagnostics(bufnr) or nil
local buf_messages = messages()
local only_hint = true
local some_diagnostics = false
local status_parts = {}
if buf_diagnostics then
if buf_diagnostics.errors and buf_diagnostics.errors > 0 then
table.insert(status_parts,
config.indicator_errors .. config.indicator_separator .. buf_diagnostics.errors)
only_hint = false
some_diagnostics = true
end

if buf_diagnostics.warnings and buf_diagnostics.warnings > 0 then
table.insert(status_parts, config.indicator_warnings .. config.indicator_separator ..
buf_diagnostics.warnings)
only_hint = false
some_diagnostics = true
end

if buf_diagnostics.info and buf_diagnostics.info > 0 then
table.insert(status_parts,
config.indicator_info .. config.indicator_separator .. buf_diagnostics.info)
only_hint = false
some_diagnostics = true
end

if buf_diagnostics.hints and buf_diagnostics.hints > 0 then
table.insert(status_parts,
config.indicator_hint .. config.indicator_separator .. buf_diagnostics.hints)
some_diagnostics = true
end
end

Expand Down Expand Up @@ -105,7 +96,7 @@ local function get_lsp_statusline(bufnr)
end

local base_status = vim.trim(table.concat(status_parts, ' ') .. ' ' .. table.concat(msgs, ' '))
local symbol = config.status_symbol .. ((some_diagnostics and only_hint) and '' or ' ')
local symbol = config.status_symbol .. ' '
if config.current_function then
local current_function = vim.b.lsp_current_function
if current_function and current_function ~= '' then
Expand Down