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

Consistent statusline padding #9691

Closed

Conversation

hamrik
Copy link
Contributor

@hamrik hamrik commented Feb 21, 2024

Closes #8061.

Statusline elements were inconsistent in their use of spacing: some had margins, some didn't, some reserved space for when they were not in use while others did not.

This PR adjusts each element to act consistently, without involving the statusline renderer:

  • Every statusline element hides when not in use.
  • Every statusline element has a single space margin.

This creates a 2 space gap between every element, avoiding confusion with spaces between words, and a 1 space padding from the statusline edges.

Since elements handle their own padding, special cases like color-modes, spacer and separator work correctly.

@hamrik
Copy link
Contributor Author

hamrik commented Feb 21, 2024

The only potential regression is that spinner no longer reserving space may cause neighboring elements to jump around. I think the most elegant solution would be to simply move it towards the inner end of either left or right in the default config, where it couldn't shift other elements.

@kirawi kirawi added the A-gui Area: Helix gui improvements label Feb 21, 2024
@hamrik hamrik force-pushed the consistent_statusline_padding branch 2 times, most recently from 7e39537 to d5a28ac Compare March 8, 2024 19:56
Statusline elements were inconsistent in their use
of spacing: some had margins, some didn't, some
reserved space for when they were not in use while
others did not.

This PR adjusts each element to act consistently,
without involving the statusline renderer:
 - Every statusline element hides when not in use.
 - Every statusline element has a 1 space margin.

This creates a 2 space gap between every element,
avoiding confusion with spaces between words, and
a 1 space padding from the statusline edges.

Since elements handle their own spacing, special
cases like `color-modes`, `spacer` and `separator`
work correctly.
Spinner no longer reserves space to remain consistent with other
elements. To prevent it from shifting elements around whenever the
LSP is busy, move the spinner to the innermost position on the left,
next to `file-modification-indicator`, where it cannot push other
elements around.
For a long time there was a TODO for handling more
than just the first connected language server on a
given buffer. Now we pick the first busy server to
display the spinner for, so we can indicate if any
attached server is busy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-gui Area: Helix gui improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Are the status line elements spaced inconsistently?
2 participants