Fixes: fakevim: implement first approximation of Ctrl-D and Ctrl-U

This commit is contained in:
hjk
2009-01-23 16:22:29 +01:00
parent 4f1dd94945
commit 8867568cb7

View File

@@ -1076,6 +1076,20 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
}
recordInsertText(str);
recordEndGroup();
} else if (key == control('d')) {
int sline = cursorLineOnScreen();
// FIXME: this should use the "scroll" option, and "count"
moveDown(linesOnScreen() / 2);
moveToFirstNonBlankOnLine();
scrollToLineInDocument(cursorLineInDocument() - sline);
finishMovement();
} else if (key == control('u')) {
int sline = cursorLineOnScreen();
// FIXME: this should use the "scroll" option, and "count"
moveUp(linesOnScreen() / 2);
moveToFirstNonBlankOnLine();
scrollToLineInDocument(cursorLineInDocument() - sline);
finishMovement();
} else if (key == Key_PageDown || key == control('f')) {
moveDown(count() * (linesOnScreen() - 2));
finishMovement();