Commit 8867568c authored by hjk's avatar hjk
Browse files

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

parent 4f1dd949
......@@ -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();
......
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