Skip to content

Commit

Permalink
Add Mac binding for beg/end of line (#1296)
Browse files Browse the repository at this point in the history
Also fix bug in "Select to end of file" shortcut - it did sel to beg.
  • Loading branch information
windymilla authored May 28, 2024
1 parent 9712259 commit ea5be11
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/lib/Guiguts/KeyBindings.pm
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,26 @@ sub keybindings {

# Extra bindings for Mac
if ($::OS_MAC) {
keybind( '<Meta-q>', sub { ::_exit(); } );
keybind( '<Meta-s>', sub { ::savefile(); } );
keybind( '<Meta-a>', sub { $textwindow->selectAll; } );
keybind( '<Meta-c>', sub { ::textcopy(); } );
keybind( '<Meta-x>', sub { ::cut(); } );
keybind( '<Meta-v>', sub { ::paste(); } );
keybind( '<Meta-f>', sub { ::searchpopup(); } );
keybind( '<Meta-Shift-f>', sub { ::quicksearchpopup(); } );
keybind( '<Meta-g>', undef, '<<FindNext>>' );
keybind( '<Meta-Shift-g>', undef, '<<FindNextReverse>>' );
keybind( '<Meta-z>', undef, '<<Undo>>' );
keybind( '<Meta-y>', undef, '<<Redo>>' );
keybind( '<Meta-Up>', [ 'SetCursor', '1.0' ] );
keybind( '<Meta-Shift-Up>', [ 'KeySelect', '1.0' ] );
keybind( '<Meta-Down>', [ 'SetCursor', 'end-1c' ] );
keybind( '<Meta-Shift-Down>', [ 'KeySelect', '1.0' ] );
keybind( '<Meta-q>', sub { ::_exit(); } );
keybind( '<Meta-s>', sub { ::savefile(); } );
keybind( '<Meta-a>', sub { $textwindow->selectAll; } );
keybind( '<Meta-c>', sub { ::textcopy(); } );
keybind( '<Meta-x>', sub { ::cut(); } );
keybind( '<Meta-v>', sub { ::paste(); } );
keybind( '<Meta-f>', sub { ::searchpopup(); } );
keybind( '<Meta-Shift-f>', sub { ::quicksearchpopup(); } );
keybind( '<Meta-g>', undef, '<<FindNext>>' );
keybind( '<Meta-Shift-g>', undef, '<<FindNextReverse>>' );
keybind( '<Meta-z>', undef, '<<Undo>>' );
keybind( '<Meta-y>', undef, '<<Redo>>' );
keybind( '<Meta-Up>', [ 'SetCursor', '1.0' ] );
keybind( '<Meta-Shift-Up>', [ 'KeySelect', '1.0' ] );
keybind( '<Meta-Down>', [ 'SetCursor', 'end-1c' ] );
keybind( '<Meta-Shift-Down>', [ 'KeySelect', 'end-1c' ] );
keybind( '<Meta-Left>', [ 'SetCursor', 'insert linestart' ] );
keybind( '<Meta-Shift-Left>', [ 'KeySelect', 'insert linestart' ] );
keybind( '<Meta-Right>', [ 'SetCursor', 'insert lineend' ] );
keybind( '<Meta-Shift-Right>', [ 'KeySelect', 'insert lineend' ] );
}

# Bookmarks - multiple key-combinations to allow for keyboard differences
Expand Down

0 comments on commit ea5be11

Please sign in to comment.