diff options
author | hjk <qtc-committer@nokia.com> | 2011-10-28 14:16:01 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2011-10-28 14:16:56 +0200 |
commit | 2ec51f5b2c5034def29501d9501875ea311b5d5b (patch) | |
tree | 835b4e3fff2764f189c05fa8d8f3a0d64a456250 /src/plugins | |
parent | 25c983a448de2fbb4bb912386d4ab1af5f699f80 (diff) | |
download | qt-creator-2ec51f5b2c5034def29501d9501875ea311b5d5b.tar.gz |
fakevim: implement :<x>%
Change-Id: I85d91429767519d7e2925e89feee6f3f83ddd3a9
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/fakevim/fakevimhandler.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 96d7d87859..2be355a9b3 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -3720,6 +3720,15 @@ bool FakeVimHandler::Private::handleExEchoCommand(const ExCommand &cmd) void FakeVimHandler::Private::handleExCommand(const QString &line0) { 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 if (line.startsWith(QLatin1Char('%'))) line = "1,$" + line.mid(1); |