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

Add mode separator to statusline #5022

Closed
wants to merge 7 commits into from
Closed

Add mode separator to statusline #5022

wants to merge 7 commits into from

Conversation

0xrsp
Copy link

@0xrsp 0xrsp commented Dec 6, 2022

Add a purely stylistic and configurable Unicode separator after the mode in the statusline.

@archseer
Copy link
Member

archseer commented Dec 6, 2022

Isn't this solved by the existing separator component?

@0xrsp
Copy link
Author

0xrsp commented Dec 6, 2022

Isn't this solved by the existing separator component?

I don't believe so, I couldn't achieve the same result with the existing separator component. I have attached images of what it looks like. Omitting the mode-separator = "..." will result in the same behaviour as flat.

Edit: it is possible to achieve a similar result with separator component, however the color won't change with your mode with color-modes.

Round:
round

Slanted:
slanted

Flat (default):
flat(default)

Angled:
angled

@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. labels Dec 6, 2022
@CptPotato
Copy link
Contributor

Looks pretty neat!

I think in the long run a more sophisticated way to configure/theme the statusline would be cool to see. That being said, it's a simple addition and I'd personally use it.

Have you considered adding different powerline symbols or allowing user defined characters for the separator? The only issue I'd see with this is that some might require inverting the fg/bg colors.

Comment on lines 206 to 211
let mode_separator = match config.statusline.mode_separator {
ModeSeparator::Angled => "",
ModeSeparator::Slanted => "",
ModeSeparator::Round => "",
ModeSeparator::Flat => unreachable!(),
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the current separator, this can just be specified as an arbitrary string rather than presets

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but I also think the presents are very reasonable and most 90% of people would be using one of the presents. I think it would be best to do a hybrid approach that lets arbitrary strings be used but also provides presets. See commit 1c2b828 for what this might look like.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These presets require a patched font to work (they're in the private use area of unicode) which is not acceptable for core. See #2211 (comment), #2377 (comment). A free-form string allows these without building it in to core.

@CptPotato
Copy link
Contributor

There still seems to be a coloring issue when using splits. The inactive split uses the inactive statusline fg as separator color, even though the mode is not shown:

image

@0xrsp
Copy link
Author

0xrsp commented Dec 9, 2022

There still seems to be a coloring issue when using splits. The inactive split uses the inactive statusline fg as separator color, even though the mode is not shown:

image

This is addressed in commit 1c2b828 by not rendering the mode separator when context is not focused.

Comment on lines +586 to +589
shift!(Tab) | key!(Up) | ctrl!('p') | ctrl!('k') => {
self.move_by(1, Direction::Backward);
}
key!(Tab) | key!(Down) | ctrl!('n') => {
key!(Tab) | key!(Down) | ctrl!('n') | ctrl!('j') => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unrelated to the PR and should be removed

@cd-a
Copy link
Contributor

cd-a commented Jun 5, 2023

Is there a reason why this was suddenly closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants