Commit b52c2bb5 authored by Laurent Montel's avatar Laurent Montel 😁

Fix whole word support

parent 57871f02
......@@ -179,8 +179,11 @@ QRegExp TextFindWidget::searchRegExp() const
} else {
reg.setCaseSensitivity(Qt::CaseInsensitive);
}
//TODO QTextDocument::FindWholeWords ?
reg.setPattern(mSearch->text());
QString searchTextString = mSearch->text();
if (mWholeWordAct->isChecked()) {
searchTextString = QStringLiteral("\\b") + searchTextString + QStringLiteral("\\b");
}
reg.setPattern(searchTextString);
return reg;
}
......
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