Commit 0a86efb8 authored by hluk's avatar hluk Committed by hjk
Browse files

FakeVim: Tilde command moves text cursor to the right



Change-Id: Ieff36ffa06b39dd7ff55551dd0fec627b8561939
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 15f58b16
......@@ -1607,6 +1607,14 @@ void FakeVimPlugin::test_vim_letter_case()
// upper- and lower-case
data.setText("abc DEF");
KEYS("~", "A" X "bc DEF");
INTEGRITY(false);
KEYS("4~", "ABC d" X "EF");
INTEGRITY(false);
data.setText("abc DEF" N "ghi");
KEYS("l9~", "aBC de" X "f" N "ghi");
KEYS(".", "aBC de" X "F" N "ghi");
KEYS("h.", "aBC dE" X "f" N "ghi");
data.setText("abc DEF");
KEYS("lv3l~", "a" X "BC dEF");
......
......@@ -3838,19 +3838,22 @@ bool FakeVimHandler::Private::handleNoSubMode(const Input &input)
else if (input.is('U'))
m_submode = UpCaseSubMode;
} else {
if (!atEndOfLine()) {
beginEditBlock();
setAnchor();
moveRight(qMin(count(), rightDist()));
if (input.is('~'))
invertCase(currentRange());
else if (input.is('u'))
downCase(currentRange());
else if (input.is('U'))
upCase(currentRange());
setDotCommand(QString::fromLatin1("%1%2").arg(count()).arg(input.raw()));
endEditBlock();
beginEditBlock();
if (atEndOfLine())
moveLeft();
setAnchor();
moveRight(qMin(count(), rightDist()));
if (input.is('~')) {
const int pos = position();
invertCase(currentRange());
setPosition(pos);
} else if (input.is('u')) {
downCase(currentRange());
} else if (input.is('U')) {
upCase(currentRange());
}
setDotCommand(QString::fromLatin1("%1%2").arg(count()).arg(input.raw()));
endEditBlock();
}
} else if (input.isKey(Key_Delete)) {
setAnchor();
......@@ -7533,6 +7536,7 @@ void FakeVimHandler::setTextCursorPosition(int position)
d->setPosition(pos);
else
d->setAnchorAndPosition(pos, pos);
d->m_fakeEnd = false;
d->setTargetColumn();
}
......
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