-
-
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
Primary cursor colors by mode #5130
Conversation
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.
Ah this is much simpler 😀
#4596 is a bit more complicated because it adds an option. We wanted a similar option for color-modes since a theme could define color-modes and you might not want to see them. I suppose that could be added to this but I don't think it's necessary since theme inheritance was merged (#3067), so let's not add it for now.
I can get behind this simpler implementation over #4596. Theme inheritance now means that we don't need the setting toggle (and probably should remove toggles for other theme related settings that can be resolved on the theme level). I only have two remarks/concerns:
Granted, point 2 is not a major issue but from a logical flow, if we consider the evolution of a theme in its development, it's a bit awkward. |
Hi, As for the first concern; The source code has to explicitly set the cursor of normal mode anyway (see the diff in this PR), so adding the The added benefit to this would for example be if a user wants to change the cursor for normal mode only; all he/she would have to do is change add a Basically, if something wants to be special, make it special. Rather than changing the rest to make it distinguishable. On the second note, I do agree with you that it makes in a way sense to have So: My answer was no to all three, and I would even argue that such changes would make things even more awkward. Hope this answered your questions. I do like the idea though about removing the other theme setting toggles. All the best :) |
Good points. Your response to 1. makes me withdraw that remark. When it comes to 2. I suppose it's what it is. To my eyes it looked like the current mental model came by chance and things being added on other things rather that it was intended to be this way. That of course is entirely an outside perspective. Overall I do agree it's a minor thing and may not get the momentum to change it (and may not deserve that momentum to begin with) I'd be happy to see this PR accepted as it would close a problem brought up in many issues and PRs over time, while only introducing a minor change at the same time. |
@archseer @the-mikedavis what's up with this PR not getting merged? Is there anything I can do on my end? |
ui.cursor.insert
and ui.cursor.select
when ui.cursor.primary
is present
#2366
* (theme) feat: mode based primary cursor colors * docs/themes: mode based primary cursor colors
@gibbz00 Hi, I am trying to add this feature to "ui.cursor.primary.normal" = { fg = "cursor", modifiers = ["reversed"] }
"ui.cursor.primary.insert" = { fg = "yellow", modifiers = ["reversed"] }
"ui.cursor.primary.select" = { fg = "magenta", modifiers = ["reversed"] } It works, but if I press "ui.cursor" = { fg = "cursor", modifiers = ["reversed"] }
"ui.cursor.primary" = { fg = "cursor", modifiers = ["reversed"] }
"ui.cursor.match" = { bg = "#3a3d41", modifiers = ["underlined"] } and is now: "ui.cursor" = { fg = "cursor", modifiers = ["reversed"] }
"ui.cursor.primary.normal" = { fg = "cursor", modifiers = ["reversed"] }
"ui.cursor.primary.insert" = { fg = "yellow", modifiers = ["reversed"] }
"ui.cursor.primary.select" = { fg = "magenta", modifiers = ["reversed"] }
"ui.cursor.primary" = { fg = "cursor", modifiers = ["reversed"] }
"ui.cursor.match" = { bg = "#3a3d41", modifiers = ["underlined"] } |
@David-Else apologies for the late reply. We're you able to resolve the issue or does it still persist? |
@gibbz00 I am afraid it still persists. The cursor does not change colour when it is over a space or invisible line end character. When I said "if I press A to add to the end of the line" I was just seeing the affect of the cursor being on an invisible line end character. Can you help? |
Bummer, but I'll see what I can do :) What I'm using in "ui.cursor" = { fg = "dark_gray", bg = "light_gray" }
"ui.cursor.primary" = { fg = "dark_gray", bg = "orange" }
"ui.cursor.primary.select" = { fg = "dark_gray", bg = "magenta" }
"ui.cursor.primary.insert" = { fg = "dark_gray", bg = "green" } Have you tried removing the "reversed" modifier and setting the cursor color using the background? Append to end of line works on my end. |
This PR is the result of a discussion held in #4298. It's an alternative solution to #4298 and #2366, which in turn closes the issues in
#1833 and#1337.In short; it adds the possibility to set primary and non-primary (secondary) cursor colors for a given mode. Compared to the other presented solutions:
Example of something that was previously not possible to do:
https://imgur.com/a/JHxYuJm
Diagram for fallback behavior:
https://imgur.com/a/Kds3606