From ea5be11c0f620292728ba40f5194294e79c65abb Mon Sep 17 00:00:00 2001 From: Nigel Date: Tue, 28 May 2024 17:16:35 +0100 Subject: [PATCH] Add Mac binding for beg/end of line (#1296) Also fix bug in "Select to end of file" shortcut - it did sel to beg. --- src/lib/Guiguts/KeyBindings.pm | 36 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/lib/Guiguts/KeyBindings.pm b/src/lib/Guiguts/KeyBindings.pm index 53220bcf..71f94fc4 100644 --- a/src/lib/Guiguts/KeyBindings.pm +++ b/src/lib/Guiguts/KeyBindings.pm @@ -239,22 +239,26 @@ sub keybindings { # Extra bindings for Mac if ($::OS_MAC) { - keybind( '', sub { ::_exit(); } ); - keybind( '', sub { ::savefile(); } ); - keybind( '', sub { $textwindow->selectAll; } ); - keybind( '', sub { ::textcopy(); } ); - keybind( '', sub { ::cut(); } ); - keybind( '', sub { ::paste(); } ); - keybind( '', sub { ::searchpopup(); } ); - keybind( '', sub { ::quicksearchpopup(); } ); - keybind( '', undef, '<>' ); - keybind( '', undef, '<>' ); - keybind( '', undef, '<>' ); - keybind( '', undef, '<>' ); - keybind( '', [ 'SetCursor', '1.0' ] ); - keybind( '', [ 'KeySelect', '1.0' ] ); - keybind( '', [ 'SetCursor', 'end-1c' ] ); - keybind( '', [ 'KeySelect', '1.0' ] ); + keybind( '', sub { ::_exit(); } ); + keybind( '', sub { ::savefile(); } ); + keybind( '', sub { $textwindow->selectAll; } ); + keybind( '', sub { ::textcopy(); } ); + keybind( '', sub { ::cut(); } ); + keybind( '', sub { ::paste(); } ); + keybind( '', sub { ::searchpopup(); } ); + keybind( '', sub { ::quicksearchpopup(); } ); + keybind( '', undef, '<>' ); + keybind( '', undef, '<>' ); + keybind( '', undef, '<>' ); + keybind( '', undef, '<>' ); + keybind( '', [ 'SetCursor', '1.0' ] ); + keybind( '', [ 'KeySelect', '1.0' ] ); + keybind( '', [ 'SetCursor', 'end-1c' ] ); + keybind( '', [ 'KeySelect', 'end-1c' ] ); + keybind( '', [ 'SetCursor', 'insert linestart' ] ); + keybind( '', [ 'KeySelect', 'insert linestart' ] ); + keybind( '', [ 'SetCursor', 'insert lineend' ] ); + keybind( '', [ 'KeySelect', 'insert lineend' ] ); } # Bookmarks - multiple key-combinations to allow for keyboard differences