godot
godot copied to clipboard
Fix code completion override of home and end keys
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
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.
I installed a macOS virtual machine to test the issue (why-oh-why it doesn't pass the unit tests on macOS!?)
why-oh-why it doesn't pass the unit tests on macOS!?
I suspect it's related to SEND_GUI_ACTION("ui_end");, this macro is sending a key combination for the action (End key on all platforms). On other platforms, ui_text_caret_line_end is the same, but not on macOS (ui_text_caret_line_end is Command+Right and Ctrl+E).
why-oh-why it doesn't pass the unit tests on macOS!?
I suspect it's related to
SEND_GUI_ACTION("ui_end");, this macro is sending a key combination for the action (Endkey on all platforms). On other platforms,ui_text_caret_line_endis the same, but not on macOS (ui_text_caret_line_endisCommand+RightandCtrl+E).
Yes. I just found out that by reading that Reddit comment.
I just added the same functionality for ui_text_caret_line_start and ui_text_caret_line_end and ~~disabled the tests for ui_home and ui_end on macOS~~ removed ui_home and ui_end.
Thanks!