Commit 2ec51f5b authored by hjk's avatar hjk Committed by hjk
Browse files

fakevim: implement :<x>%



Change-Id: I85d91429767519d7e2925e89feee6f3f83ddd3a9
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 25c983a4
...@@ -3720,6 +3720,15 @@ bool FakeVimHandler::Private::handleExEchoCommand(const ExCommand &cmd) ...@@ -3720,6 +3720,15 @@ bool FakeVimHandler::Private::handleExEchoCommand(const ExCommand &cmd)
void FakeVimHandler::Private::handleExCommand(const QString &line0) void FakeVimHandler::Private::handleExCommand(const QString &line0)
{ {
QString line = line0; // Make sure we have a copy to prevent aliasing. QString line = line0; // Make sure we have a copy to prevent aliasing.
if (line.endsWith(QLatin1Char('%'))) {
line.chop(1);
int percent = line.toInt();
setPosition(firstPositionInLine(percent * linesInDocument() / 100));
showBlackMessage(QString());
return;
}
// FIXME: that seems to be different for %w and %s // FIXME: that seems to be different for %w and %s
if (line.startsWith(QLatin1Char('%'))) if (line.startsWith(QLatin1Char('%')))
line = "1,$" + line.mid(1); line = "1,$" + line.mid(1);
......
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