fakevim: more vim-ish behaviour of page up and down

This commit is contained in:
hjk
2009-03-25 15:17:58 +01:00
parent 0807ca53c9
commit 6d8223517f

View File

@@ -1417,10 +1417,14 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
recordInsertText(str);
recordEndGroup();
} else if (key == Key_PageDown || key == control('f')) {
moveDown(count() * (linesOnScreen() - 2));
moveDown(count() * (linesOnScreen() - 2) - cursorLineOnScreen());
scrollToLineInDocument(cursorLineInDocument());
moveToFirstNonBlankOnLine();
finishMovement();
} else if (key == Key_PageUp || key == control('b')) {
moveUp(count() * (linesOnScreen() - 2));
moveUp(count() * (linesOnScreen() - 2) + cursorLineOnScreen());
scrollToLineInDocument(cursorLineInDocument() + linesOnScreen() - 2);
moveToFirstNonBlankOnLine();
finishMovement();
} else if (key == Key_Delete) {
setAnchor();