Skip to content

Commit

Permalink
Save some lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiolo committed Oct 11, 2023
1 parent 9f42183 commit 83b1ad8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,17 +914,11 @@ struct Document {
if (uk == WXK_NONE || (k < ' ' && k) || k == WXK_DELETE) {
switch (k) {
case WXK_BACK: // no menu shortcut available in wxwidgets
if (!ctrl) {
return Action(dc, A_BACKSPACE);
} else { // prevent Ctrl+H from being treated as Backspace
break;
}
if (!ctrl) return Action(dc, A_BACKSPACE);
break; // Prevent Ctrl+H from being treated as Backspace
case WXK_RETURN:
if (!ctrl) {
return Action(dc, shift ? A_ENTERGRID : A_ENTERCELL);
} else { // prevent Ctrl+M from being treated as Return
break;
}
if (!ctrl) return Action(dc, shift ? A_ENTERGRID : A_ENTERCELL);
break; // Prevent Ctrl+M from being treated as Return
case WXK_ESCAPE: // docs say it can be used as a menu accelerator, but it does not
// trigger from there?
return Action(dc, A_CANCELEDIT);
Expand Down

0 comments on commit 83b1ad8

Please sign in to comment.