Commit 6d822351 authored by hjk's avatar hjk
Browse files

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

parent 0807ca53
...@@ -1417,10 +1417,14 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, ...@@ -1417,10 +1417,14 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
recordInsertText(str); recordInsertText(str);
recordEndGroup(); recordEndGroup();
} else if (key == Key_PageDown || key == control('f')) { } else if (key == Key_PageDown || key == control('f')) {
moveDown(count() * (linesOnScreen() - 2)); moveDown(count() * (linesOnScreen() - 2) - cursorLineOnScreen());
scrollToLineInDocument(cursorLineInDocument());
moveToFirstNonBlankOnLine();
finishMovement(); finishMovement();
} else if (key == Key_PageUp || key == control('b')) { } else if (key == Key_PageUp || key == control('b')) {
moveUp(count() * (linesOnScreen() - 2)); moveUp(count() * (linesOnScreen() - 2) + cursorLineOnScreen());
scrollToLineInDocument(cursorLineInDocument() + linesOnScreen() - 2);
moveToFirstNonBlankOnLine();
finishMovement(); finishMovement();
} else if (key == Key_Delete) { } else if (key == Key_Delete) {
setAnchor(); setAnchor();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment