-
-
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
[WIP] feat: Setting toggle for mode dependent cursor block color #4596
Conversation
@the-mikedavis Thought I ping you here since you wanted to look at the implementation in a PR. |
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 would also need some changes added to https://github.com/helix-editor/helix/blob/master/book/src/themes.md
@@ -337,48 +332,71 @@ impl EditorView { | |||
doc: &Document, | |||
view: &View, | |||
theme: &Theme, | |||
cursor_shape_config: &CursorShapeConfig, | |||
config: &DynGuard<Config>, |
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.
config: &DynGuard<Config>, | |
config: &helix_view::editor::Config, |
see render_text_highlights
which also takes config. This will eliminate the new imports.
@@ -174,6 +174,8 @@ pub struct Config { | |||
pub indent_guides: IndentGuidesConfig, | |||
/// Whether to color modes with different colors. Defaults to `false`. | |||
pub color_modes: bool, | |||
/// Whether the cursor matches the mode as specified by `ui.cursor.insert` and `ui.cursor.select`. Defaults to `false`. |
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.
/// Whether the cursor matches the mode as specified by `ui.cursor.insert` and `ui.cursor.select`. Defaults to `false`. | |
/// Whether to theme the cursor according to the editor mode. Defaults to `false`. |
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.
We might want to clarify the docs for color_modes
too: "Whether to theme the mode statusline element according to the editor mode. Defaults to false
"
I like the look of this; I think this is a sane way to tackle the cursor scopes 👍 Before we proceed - I'm curious what you think @archseer? |
I am still interested in implementing this. Are we waiting on input from @archseer ? |
Maybe I'm a tad bit too tired to fully understand this PR, but aren't we overcomplicating this feature? Correct me if I'm wrong; this PR makes it possible to have specific colors to both primary and regular (secondary) cursor for each specific mode, right? Why can't we just implement a Where ui.cursor(.mode) is the fallback if primary isn't explicitly set. The only difference in behavior would be that No complex state driven theming with the No And most importantly; no deprecation of people's theme overrides and breaking changes to each and every theme. |
There was a similar discussion on #2366 |
I think this should be solved on the theme level for sure, no user config options |
|
Oh, thanks, must have missed the PR for #1337. Replying here though to preserve the discussion context.
Mmm as @the-mikedavis pointed out in #4298, default fallback behavior for themes is a.b.c falls back to a.b which falls back to a. If this principle is followed, then After reading #2366 on the other hand, it's clear that it's possible to add this feature with no change to current behavior whatsoever. That is; implement When I come to think about it, I personally am starting to prefer this solution. It explains why Anyhow, I created a PR where the changes can be viewed, thinking it would be easier than asking for changes in the respective PRs. Documentation updates have also been prepared. #5130 |
Replaced by #5130 |
This PR addresses #4298, #1833, #1337 and offering an alternative solution to #2366.
It follows the implementation suggested #4298. As part of this implementation, this PR immediately deprecates the parent theming field
ui.cursor.primary
and its children, replacing them with theui.cursor.secondary
family, as discussed in #4298.For demonstration purposes, the only internal theme updated with this change is
dracula.toml
.TODO: