-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
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 Edit: it is possible to achieve a similar result with separator component, however the color won't change with your mode with |
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. |
helix-term/src/ui/statusline.rs
Outdated
let mode_separator = match config.statusline.mode_separator { | ||
ModeSeparator::Angled => "", | ||
ModeSeparator::Slanted => "", | ||
ModeSeparator::Round => "", | ||
ModeSeparator::Flat => unreachable!(), | ||
}; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This is addressed in commit 1c2b828 by not rendering the mode separator when context is not focused. |
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') => { |
There was a problem hiding this comment.
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
Is there a reason why this was suddenly closed? |
@0xrsp an plan to continue working on this? |
works well enough in current state for me |
Add a purely stylistic and configurable Unicode separator after the mode in the statusline.