FakeVim: Allow to jump to the first quoted block on line

Task-number: QTCREATORBUG-12128
Change-Id: I3376a2f75307eaad1671d5b8b70ac7ba3035fdb8
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hluk
2014-05-01 08:06:49 +02:00
committed by hjk
parent 4e78a95263
commit 91d0739b97
2 changed files with 10 additions and 1 deletions

View File

@@ -1339,6 +1339,15 @@ void FakeVimPlugin::test_vim_block_selection()
KEYS("u", "\"" X "abc\"\"def\"");
KEYS("<c-r>", "\"" X "\"\"def\"");
/* QTCREATORBUG-12128 */
data.setText("abc \"def\" ghi \"jkl\" mno");
KEYS("di\"", "abc \"" X "\" ghi \"jkl\" mno");
KEYS("u", "abc \"" X "def\" ghi \"jkl\" mno");
KEYS("3l" "di\"", "abc \"" X "\" ghi \"jkl\" mno");
KEYS("di\"", "abc \"" X "\" ghi \"jkl\" mno");
KEYS("tj" "di\"", "abc \"\" ghi \"" X "\" mno");
KEYS("l" "di\"", "abc \"\" ghi \"\"" X " mno");
NOT_IMPLEMENTED
// quoted string with escaped character
data.setText("\"abc\"");

View File

@@ -8229,7 +8229,7 @@ bool FakeVimHandler::Private::selectQuotedStringTextObject(bool inner,
QTextCursor tc2(document());
while (tc2 <= tc) {
tc1 = document()->find(quote, tc2);
if (tc1.isNull() || tc1.anchor() > tc.position())
if (tc1.isNull())
return false;
tc2 = document()->find(quote, tc1);
if (tc2.isNull())