-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Toggle for mode dependent cursor block color / cursor block color theming rewrite #4298
Comments
This would be inconsistent with the default fallback behavior for themes ( |
I think there is a good point @the-mikedavis. To which part are you referring to exactly? If I understand correctly it's the fallback of |
Oh I see, I misread the part on eliminating I would prefer to keep the |
I did see #2366 but didn't consider it too closely since it didn't seem to get much traction. I also found that having Before I realized that Having thought about it for a while, switching from I think the question is largely how mature you consider Helix to be, whether my proposed change is acceptable or not. It does break current behavior but the biult-in themes can be migrated, so the question how user-facing the theming system is remains. Also to be clear, my main desire with this issue was to implement the |
Is this something you are still interested in? |
I think I would need to see this as a PR to fully understand the change - could you open one up?
That's not such a big deal - there isn't really a guarantee of stability since we use calendar versioning (although we try to only make breaking changes when there's a solid advantage to it). Migrating the in-repo themes would help a bunch with that 👍 |
@the-mikedavis sounds good, will do when I get around to it. Migrating the in-repo themes I would then do if the PR is otherwise in principle accepted. |
Closed by #5130 |
I really like the colored mode indicator in the statusline toggled by
editor.color-mode
. I am desiring a similar option for coloring the cursor block according to the mode (i.e.editor.cursor-color-mode
). So I went about looking at implementing this to potentially make a PR for this down the line.In researching if a similar effort is already worked on I stumbled upon #1337 and the tangentially related #1833. To my surprise the feature is essentially implemented but is difficult to discover or to turn into an option since many themes implement the overwriting
ui.cursor.primary
setting, as pointed out in #1337.I propose to deprecate
ui.cursor.primary
, withui.cursor
taking its place for theming the primary cursor block. The current role ofui.cursor
of theming the secondary cursor block would then be taken by the newui.cursor.secondary
theme parameter. (For consistency, this will also deprecateui.selection.primary
and introduceui.selection.secondary
following the same logic).While this is a breaking change, I think it comes with a number of advantages that will pay off going forward.
With this proposed change the cursor theming logic would as follows:
ui.selection
sets the primary selection color. Mandatory.ui.cursor
sets the primary cursor block color. Sets the primary cursor block color inNORMAL
mode ifeditor.cursor-color-mode true
. Fallback toui.cursor
. Fallback toui.selection
.ui.cursor.insert
sets the primary cursor block color inINSERT
mode ifeditor.cursor-color-mode true
. Fallback toui.cursor
.ui.cursor.select
sets the primary cursor block color inSELECT
mode ifeditor.cursor-color-mode true
. Fallback toui.cursor
.ui.selection.secondary
sets the secondary selection color. Fallback toui.selection
ui.cursor.secondary
sets the secondary cursor block color. Sets the secondary cursor block color inNORMAL
mode ifeditor.cursor-color-mode true
. Fallback toui.cursor
.ui.cursor.secondary.insert
sets the secondary cursor block color inINSERT
mode ifeditor.cursor-color-mode true
. Fallback toui.cursor.secondary
.ui.cursor.secondary.select
sets the secondary cursor block color inSELECT
mode ifeditor.cursor-color-mode true
. Fallback toui.cursor.secondary
.Below is the same control flow in a flowchart. Arrows denote the traversal order of the parameters. For fallback behavior follow them in the opposite direction.
Now again, I realize this breaks the current theming implementation. So if you are interested in this rewrite, I’d be happy to update all currently implemented themes as part of the PR. Feel free to check out my proof-of-concept implementation. The changes are largely limited to
fn doc_selection_highlights
The text was updated successfully, but these errors were encountered: