fakevim: make 'w' stop on empty lines

Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
Martin Aumüller
2010-01-21 17:38:26 +01:00
committed by hjk
parent 9e73236a0e
commit d323d7701e

View File

@@ -2750,7 +2750,6 @@ void FakeVimHandler::Private::handleFfTt(int key)
void FakeVimHandler::Private::moveToNextWord(bool simple)
{
// FIXME: 'w' should stop on empty lines, too
int repeat = count();
int n = lastPositionInDocument();
int lastClass = charClass(characterAtCursor(), simple);
@@ -2763,6 +2762,10 @@ void FakeVimHandler::Private::moveToNextWord(bool simple)
break;
lastClass = thisClass;
moveRight();
if (m_tc.block().length() == 1) // empty line
--repeat;
if (repeat == 0)
break;
if (m_tc.position() == n)
break;
}