-
-
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
fix: line numbers remain relative when helix loses focus #7955
Conversation
If `line number = relative` and a new window is opened in helix, lines inside unfocused windows will be `absolute`. This commit adds the same thing when helix becomes unfocused in a terminal emulator.
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 potentially has some implementatiom overlap with #6858
We should settle on field so this doesn't conflict with #6858 otherwise looks good |
|
I changed the name to match the mentioned pr. This is a bit like crutch, but I don't want to change |
That looks good to me now👍 |
@@ -171,7 +174,7 @@ impl EditorView { | |||
view, | |||
view.area, | |||
theme, | |||
is_focused, | |||
is_focused & self.terminal_focused, |
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.
The use of a single &
here is a little confusing. Wouldn't it have been better to just use &&
here for clarity?
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.
It's already merged, I'm not going to create a PR for this small change.
Anyway, it is not difficult to learn bitwise operators and improve your programming knowledge a little.
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.
There's just no reason to add complexity by making this a bit-wise operation rather than a logical AND operation, especially in an open source project with this many moving pieces. I didn't expect a PR be made for this small change, was just pointing it out.
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.
A bitwise operation on bool is no less clearer than a logical operation. I prefer the code as is.
…r#7955) * fix: line numbers remain relative when helix loses focus If `line number = relative` and a new window is opened in helix, lines inside unfocused windows will be `absolute`. This commit adds the same thing when helix becomes unfocused in a terminal emulator. * partial rebase
…r#7955) * fix: line numbers remain relative when helix loses focus If `line number = relative` and a new window is opened in helix, lines inside unfocused windows will be `absolute`. This commit adds the same thing when helix becomes unfocused in a terminal emulator. * partial rebase
…r#7955) * fix: line numbers remain relative when helix loses focus If `line number = relative` and a new window is opened in helix, lines inside unfocused windows will be `absolute`. This commit adds the same thing when helix becomes unfocused in a terminal emulator. * partial rebase
If
line number = relative
and a new window is opened in helix, lines inside unfocused windows will beabsolute
. This commit adds the same thing when helix becomes unfocused in a terminal emulator (or on screen in general).I thought about introducing a new
set_focus(self, bool)
editor method, but saw that almost everyEditor
field was public so I decided to change it manually.Small discussion: #7954