-
-
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 ability to theme cursor and primary selection #325
Conversation
This would allow changing the cursor styling but to change the shape itself we'll have to change this: helix/helix-view/src/editor.rs Lines 285 to 297 in fc39a6c
|
ae521d1
to
3575377
Compare
I am confused in the last image, why is there two white bold cursor? Shouldn't the original cursor be brighter? Other than the blue and purple which can't distinguish easily which is the main selection, how does one determine which is the cursor for the primary selection just by looking at the cursor? |
There is no original cursor, all cursors have the same styling.
I'm not really proposing this colors, I just wanted to demo it. Perhaps should've used more distinguishable colors.
Just from the cursor I don't think you can for now, the selection might be helpful here. |
Yeah, this looks clear to me. Just wondering, what does |
You can have both ui.cursor.primary and ui.cursor.insert and merge the two styles using patch, this is how I do it on my branch: helix/helix-term/src/ui/editor.rs Line 320 in d1ac1a5
The question is just which one should take precedence. I'm significantly changing selection rendering so I haven't had time to test this branch out yet. I'll probably merge it then rebase mine |
Note: for the most part it's not important which selection is primary, which is why they are/were all styled the same by default. But it's good to have this as a theming option. (I actually found the first preview to be nice and subtle) |
helix-term/src/ui/editor.rs
Outdated
let scope = match doc.mode() { | ||
Mode::Insert => "ui.cursor.insert", | ||
Mode::Select => "ui.cursor.select", | ||
Mode::Normal => "ui.cursor", |
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.
Why shouldn't this be ui.cursor.normal
?
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.
Was thinking that too at first. I would actually keep it as ui.cursor
, this way the insert and select ones can fall back to it if they're not defined
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 was also considering making it ui.cursor.normal
but I think as @archseer said it makes more sense as a fallback.
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.
But the issue is users would not understand the heuristic if all of us here "think that too at first". Then users have to go through our thought process to know why was the decision made this way. Do you think that is a better tradeoff for visibility vs simplicity?
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 didn't say I considered it first, I just said I considered it as an option. Actually at first I came up with ui.cursor
because that is what for example vim does, you have Cursor
and iCursor
as highlight groups and not nCursor
but perhaps in this case with 3 this is a bit different. I thought vim also had the vCursor
but that seems to only be for gui.
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 think it makes sense, you're defining a color for ui.cursor
but if you'd like to change the style for ui.cursor.insert
or ui.cursor.select
you can override it. I anticipate most themes should just define a ui.cursor
.
Perhaps this might be a solution for #323 ?