fakevim: Star and hash search with g

Added g* and g# commands to search without \<, \>.

Change-Id: I74f010f2415e4d493be9925ab047a1c06f35d7a9
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Lukas Holecek
2012-10-01 17:37:34 +02:00
committed by hjk
parent f357502984
commit d2bf853ca1
2 changed files with 17 additions and 1 deletions

View File

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