fakevim: Searching with star and hash should escape regex

Change-Id: Ia1db4eca8841209eb960191221606d94b216e3b6
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Lukas Holecek
2012-10-03 16:46:58 +02:00
committed by hjk
parent 1e6cd8af47
commit ca48d81c28

View File

@@ -2776,10 +2776,9 @@ EventResult FakeVimHandler::Private::handleCommandMode1(const Input &input)
QString needle;
QTextCursor tc = cursor();
tc.select(QTextCursor::WordUnderCursor);
if (m_gflag)
needle = tc.selection().toPlainText();
else
needle = "\\<" + tc.selection().toPlainText() + "\\>";
needle = QRegExp::escape(tc.selection().toPlainText());
if (!m_gflag)
needle = "\\<" + needle + "\\>";
setAnchorAndPosition(tc.position(), tc.anchor());
g.searchBuffer.historyPush(needle);
g.lastSearch = needle;