Skip to content

Commit

Permalink
Avoid side effects of scrolling with Alt key pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiolo committed Sep 13, 2023
1 parent c6b3c66 commit 6937bbe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -973,12 +973,14 @@ struct Document {
return Action(
dc, shift ? (ctrl ? A_PREVFILE : A_PREV) : (ctrl ? A_NEXTFILE : A_NEXT));
case WXK_PAGEUP:
if (ctrl) return Action(dc, A_ZOOMIN);
sw->CursorScroll(0, -g_scrollratecursor);
if (ctrl && !alt) return Action(dc, A_ZOOMIN);
if (ctrl && alt) return Action(dc, A_INCWIDTHNH);
if (!alt) sw->CursorScroll(0, -g_scrollratecursor);
return nullptr;
case WXK_PAGEDOWN:
if (ctrl) return Action(dc, A_ZOOMOUT);
sw->CursorScroll(0, g_scrollratecursor);
if (ctrl && !alt) return Action(dc, A_ZOOMOUT);
if (ctrl && alt) return Action(dc, A_DECWIDTHNH);
if (!alt) sw->CursorScroll(0, g_scrollratecursor);
return nullptr;
#endif
}
Expand Down

0 comments on commit 6937bbe

Please sign in to comment.