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

Always add a space after status_symbol #41

Open nerosnm opened 3 years ago

nerosnm commented 3 years ago

I noticed once I'd set this up that when I only had hints, no space was being added after the status symbol:

Hint With No Space

I expected to find when I looked in the code that this was unintentional, but this looks pretty intentional. However, I think this should be considered a bug, because it treats hints differently from the other types of diagnostics.

This change makes the diagnostics when there are only hints...

Hint With Space

...render the same as when there are other types of diagnostics too, e.g. hints and errors:

Screenshot 2021-03-02 at 11 35 06

wbthomason commented 3 years ago

Thanks! As mentioned in #35 (which this will close), this was because the statusline proof-of-concept code came from my own setup, which uses a double-wide symbol for hints and looks wrong with a space added.

I'm happy to merge this and make handling of the different diagnostics types more consistent, but perhaps we should also change the default symbol (https://github.com/nvim-lua/lsp-status.nvim/blob/925acdab0886fe5f0752561ea49e95b9f02e09c7/lua/lsp-status.lua#L9) in this PR, to ensure that things still look correct with the defaults?

nerosnm commented 3 years ago

Ah okay, I understand. So we'd need to change the default indicator_hint so that it has a space before it?

wbthomason commented 3 years ago

That's one option, I suppose. I more meant that we'd just change the default indicator_hint symbol to one that isn't double-wide and therefore will look OK with the space added after it.