Skip to content

Commit 48a8481

Browse files
committed
Allow using extended regular expressions in the find dialogs
This adds support for searching "this|that" to find either "this" or "that" or using quantifiers like "{number}". The change applies to the Find/Replace dialog and the search bar. See https://en.cppreference.com/w/cpp/regex/ecmascript for details of the syntax. This raises the requirement for an external version of QScintilla to v2.11. See issue #1625
1 parent cd748d0 commit 48a8481

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ExtendedScintilla.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ bool ExtendedScintilla::findText(QString text, bool regexp, bool caseSensitive,
244244
}
245245

246246
return findFirst(text, regexp, caseSensitive, words, wrap, forward,
247-
/* line */ -1, /* index */ -1, /* show */ true, /* posix */ true);
247+
/* line */ -1, /* index */ -1,
248+
/* show */ true, /* posix */ true, /* cxx11 */ true);
248249
}
249250

250251
void ExtendedScintilla::setEnabledFindDialog(bool value)

src/FindReplaceDialog.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ bool FindReplaceDialog::findFirst(bool wrap, bool forward)
5454
ui->wholeWordsCheckBox->isChecked(),
5555
forward,
5656
/* show */ true,
57-
/* posix */ true);
57+
/* posix */ true,
58+
/* cxx11 */ true);
5859
else
5960
return m_scintilla->findFirst
6061
(ui->findText->text(),
@@ -66,7 +67,8 @@ bool FindReplaceDialog::findFirst(bool wrap, bool forward)
6667
/* line */ -1,
6768
/* index */ -1,
6869
/* show */ true,
69-
/* posix */ true);
70+
/* posix */ true,
71+
/* cxx11 */ true);
7072
}
7173

7274
bool FindReplaceDialog::findNext()

0 commit comments

Comments
 (0)