godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix code completion override of home and end keys

Open adamscott opened this issue 2 years ago • 2 comments

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

adamscott avatar Jan 16 '23 17:01 adamscott

Checked a few other editors, this seems to be the common behaviour. Couple of unit tests are failing on macOS otherwise looks good.

Paulb23 avatar Jan 28 '23 15:01 Paulb23

I wonder if macOS has another behavior when using home and end keys.

adamscott avatar Jan 29 '23 04:01 adamscott

I installed a macOS virtual machine to test the issue (why-oh-why it doesn't pass the unit tests on macOS!?)

adamscott avatar Oct 06 '23 13:10 adamscott

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).

bruvzg avatar Oct 06 '23 14:10 bruvzg

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).

Yes. I just found out that by reading that Reddit comment.

adamscott avatar Oct 06 '23 14:10 adamscott

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.

adamscott avatar Oct 06 '23 14:10 adamscott

Thanks!

akien-mga avatar Oct 09 '23 13:10 akien-mga