-
-
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
change the behavior of ui.cursor.insert
and ui.cursor.select
when ui.cursor.primary
is present
#2366
Conversation
The motivation is that This change would make Another option to consider is adding the options |
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.
Another option to consider is adding the options ui.cursor.{insert,select}.primary to allow more complex theming.
This seems more reasonable to me but it's tricky. What would the fallback there be? ui.cursor.primary
? Or ui.cursor.insert
let cursor_scope = if theme.find_scope_index("ui.cursor.primary").is_some() { | ||
base_cursor_scope | ||
} else { | ||
mode_cursor_scope.unwrap_or(base_cursor_scope) | ||
}; | ||
|
||
let primary_cursor_scope = | ||
if let Some(base_primary_cursor_scope) = theme.find_scope_index("ui.cursor.primary") { | ||
mode_cursor_scope.unwrap_or(base_primary_cursor_scope) | ||
} else { | ||
cursor_scope | ||
}; |
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'm a bit confused by the conditionals here.
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 chooses between mode_cursor_scope
and base_cursor_scope
/base_primary_cursor_scope
depending on whether ui.cursor.primary
is present.
I'm considering making a new PR that cleans up the code to make all of the defaults and fallbacks clearer, and adding code for ui.cursor.{insert,select}.primary
over it.
The current behavior chooses One argument for making Falling back to |
f3d7643
to
a8cbde1
Compare
Replaced by #5130 |
Fixes #1337
Previously,
ui.cursor.insert
andui.cursor.select
only applied to non-primary cursors whenui.cursor.primary
was present.This PR changes this behavior to make
ui.cursor.insert
andui.cursor.select
only affect the primary cursor whenui.cursor.primary
is set.