-
-
Notifications
You must be signed in to change notification settings - Fork 21.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 code completion override of home and end keys #71519
Fix code completion override of home and end keys #71519
Conversation
2bd0de4
to
560af4e
Compare
Checked a few other editors, this seems to be the common behaviour. Couple of unit tests are failing on macOS otherwise looks good. |
I wonder if macOS has another behavior when using home and end keys. |
6e52cc8
to
0a9474e
Compare
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.
Approved in Input PR review
Edit: the failing check needs a fix first though.
14dd757
to
ec5fafc
Compare
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.
Tested locally (rebased on top of master
d31794c), it works as expected.
simplescreenrecorder-2023-10-05_22.36.59.mp4
TIL pressing Home several times cycles between the beginning of the line with and without leading whitespace (like in VS Code) 🙂
An unit test needs to be fixed before this can be merged.
I installed a macOS virtual machine to test the issue (why-oh-why it doesn't pass the unit tests on macOS!?) |
I suspect it's related to |
Yes. I just found out that by reading that Reddit comment. |
ec5fafc
to
b8fa37c
Compare
I just added the same functionality for |
b8fa37c
to
3050616
Compare
scene/gui/code_edit.cpp
Outdated
if ( | ||
k->is_action("ui_text_caret_line_start", true) || | ||
k->is_action("ui_text_caret_line_end", true)) { |
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's more readable on a single line than on three like this (I know it's clang-format doing it but it makes it not worth it).
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.
That's a left over of these being 4 checks instead of 2. I'm correcting this.
3050616
to
25cbb68
Compare
Thanks! |
Changes the behaviour of the home and end keys when the autocomplete popup is open.
Rather than going to the top and the bottom of the list, home and end closes the autocomplete popup and work as usual.
Fixes #71471