FakeVim: Emulate search more precisely

Submitting search highlights (if 'hlsearch' enabled) in visible editors.

Update highlights after 'nohlsearch' command, 'set hlsearch' and
changing document.

Change-Id: I66ed8c6e9c6e99f3c64f91cdec5ac5feb636d2cb
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hluk
2013-08-06 17:13:53 +02:00
committed by hjk
parent 91e6d27a73
commit d15fb5a75c
2 changed files with 36 additions and 18 deletions

View File

@@ -1987,11 +1987,12 @@ void FakeVimPluginPrivate::changeSelection(const QList<QTextEdit::ExtraSelection
void FakeVimPluginPrivate::highlightMatches(const QString &needle)
{
IEditor *editor = EditorManager::currentEditor();
QWidget *w = editor->widget();
Find::IFindSupport *find = Aggregation::query<Find::IFindSupport>(w);
if (find != 0)
find->highlightAll(needle, Find::FindRegularExpression | Find::FindCaseSensitively);
foreach (IEditor *editor, EditorManager::instance()->visibleEditors()) {
QWidget *w = editor->widget();
Find::IFindSupport *find = Aggregation::query<Find::IFindSupport>(w);
if (find != 0)
find->highlightAll(needle, Find::FindRegularExpression | Find::FindCaseSensitively);
}
}
int FakeVimPluginPrivate::currentFile() const