Skip to content

Commit bb5d0b7

Browse files
committed
UI: avoid unwanted scrolling
1 parent 9be583f commit bb5d0b7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ui/textedit.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,17 +642,16 @@ bool TextEditInput::edit(int key, int screenWidth, int charWidth) {
642642
}
643643

644644
_cursorRow = getCursorRow();
645-
if (key == STB_TEXTEDIT_K_UP) {
645+
if (key == STB_TEXTEDIT_K_UP ||
646+
key == (int)SB_KEY_SHIFT(STB_TEXTEDIT_K_UP)) {
646647
if (_cursorRow == _scroll) {
647648
updateScroll();
648649
}
649-
} else if (key == STB_TEXTEDIT_K_DOWN) {
650+
} else {
650651
int pageRows = _height / _charHeight;
651652
if (_cursorRow - _scroll > pageRows) {
652653
updateScroll();
653654
}
654-
} else {
655-
updateScroll();
656655
}
657656
findMatchingBrace();
658657
return true;

0 commit comments

Comments
 (0)