nvim-lua / lsp-status.nvim

Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
MIT License
621 stars 41 forks source link

separator between indicator and count intended? #56

Closed p00f closed 3 years ago

p00f commented 3 years ago

image

https://github.com/nvim-lua/lsp-status.nvim/blob/7c376c3924d4f807d6ce49450fdeaa18720349c9/lua/lsp-status/statusline.lua#L49

Was this intended? Aren't the separators supposed to be between different types of info?

p00f commented 3 years ago

If not, I'll make a PR (but I think it will be messy)

wbthomason commented 3 years ago

What font are you using, and do you have customized symbols? I cannot reproduce this visually in my setup - it looks like https://github.com/nvim-lua/lsp-status.nvim/blob/master/images/some_errors.png for me.

p00f commented 3 years ago

That screenshot doesn't use separators ._.

p00f commented 3 years ago

The separator used is the normal symbol for "or" - the one you get when you press shift+backslash

p00f commented 3 years ago
require "lsp-status".config({
    indicator_separator = "|",
    .......
})
p00f commented 3 years ago

also, the code snippet i mentioned seems to insert the separator between the indicator and the count

https://github.com/nvim-lua/lsp-status.nvim/blob/7c376c3924d4f807d6ce49450fdeaa18720349c9/lua/lsp-status/statusline.lua#L49

wbthomason commented 3 years ago

That screenshot does use separators, but they're whitespace (the default).

also, the code snippet i mentioned seems to insert the separator between the indicator and the count

Yes - I think this is an issue of poor/ambiguous variable naming. In https://github.com/nvim-lua/lsp-status.nvim/pull/29, where indicator_separator was introduced, it's clear that the purpose of the separator is to go between the diagnostic symbol and count (hence why the default is whitespace).

However, your intended use (separating the different diagnostic components) is also reasonable. Right now, we don't have a config var for that separator - we hardcode whitespace: https://github.com/nvim-lua/lsp-status.nvim/blob/7c376c3924d4f807d6ce49450fdeaa18720349c9/lua/lsp-status/statusline.lua#L107

Maybe the solution here is

  1. Add a config var for the symbol, defaulting to whitespace, that separates statusline components
  2. Rename indicator_separator to be clearer
  3. Add a notice to the README of this breaking change

What do you think?

p00f commented 3 years ago

Make the new one component_separator and don't break anyone's config, just make it clear in the README?

wbthomason commented 3 years ago

Sure, that works too. I would still like to rename the config variables to be clearer, but that can wait for another PR to group any breaking changes we want to introduce.

wbthomason commented 3 years ago

@p00f: can you please try #57 to see if it does what you want? We may need to tweak exactly where component_separator gets used - right now, I still hardcode whitespace for the start and end of the set of information blocks, which is (imo) visually nicer but kind of an edge case hack.

p00f commented 3 years ago

image

image

Nice!