Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show All 30 Lines | |||||
31 | #include "katebuffer.h" | 31 | #include "katebuffer.h" | ||
32 | #include "kateconfig.h" | 32 | #include "kateconfig.h" | ||
33 | #include "katedialogs.h" | 33 | #include "katedialogs.h" | ||
34 | #include "kateglobal.h" | 34 | #include "kateglobal.h" | ||
35 | #include "katehighlight.h" | 35 | #include "katehighlight.h" | ||
36 | #include "katemodemanager.h" | 36 | #include "katemodemanager.h" | ||
37 | #include "katepartdebug.h" | 37 | #include "katepartdebug.h" | ||
38 | #include "kateplaintextsearch.h" | 38 | #include "kateplaintextsearch.h" | ||
39 | #include "kateregexp.h" | | |||
40 | #include "kateregexpsearch.h" | 39 | #include "kateregexpsearch.h" | ||
41 | #include "katerenderer.h" | 40 | #include "katerenderer.h" | ||
42 | #include "kateschema.h" | 41 | #include "kateschema.h" | ||
43 | #include "katescriptmanager.h" | 42 | #include "katescriptmanager.h" | ||
44 | #include "kateswapfile.h" | 43 | #include "kateswapfile.h" | ||
45 | #include "katetemplatehandler.h" | 44 | #include "katetemplatehandler.h" | ||
46 | #include "katetextline.h" | 45 | #include "katetextline.h" | ||
47 | #include "kateundomanager.h" | 46 | #include "kateundomanager.h" | ||
▲ Show 20 Lines • Show All 1719 Lines • ▼ Show 20 Line(s) | 1764 | { | |||
1767 | const bool regexMode = options.testFlag(KTextEditor::Regex); | 1766 | const bool regexMode = options.testFlag(KTextEditor::Regex); | ||
1768 | const bool backwards = options.testFlag(KTextEditor::Backwards); | 1767 | const bool backwards = options.testFlag(KTextEditor::Backwards); | ||
1769 | const bool wholeWords = options.testFlag(KTextEditor::WholeWords); | 1768 | const bool wholeWords = options.testFlag(KTextEditor::WholeWords); | ||
1770 | const Qt::CaseSensitivity caseSensitivity = options.testFlag(KTextEditor::CaseInsensitive) ? Qt::CaseInsensitive : Qt::CaseSensitive; | 1769 | const Qt::CaseSensitivity caseSensitivity = options.testFlag(KTextEditor::CaseInsensitive) ? Qt::CaseInsensitive : Qt::CaseSensitive; | ||
1771 | 1770 | | |||
1772 | if (regexMode) { | 1771 | if (regexMode) { | ||
1773 | // regexp search | 1772 | // regexp search | ||
1774 | // escape sequences are supported by definition | 1773 | // escape sequences are supported by definition | ||
1775 | KateRegExpSearch searcher(this, caseSensitivity); | 1774 | QRegularExpression::PatternOptions patternOptions; | ||
1776 | return searcher.search(pattern, range, backwards); | 1775 | patternOptions |= (caseSensitivity == Qt::CaseInsensitive) ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption; | ||
1776 | KateRegExpSearch searcher(this); | ||||
1777 | return searcher.search(pattern, range, backwards, patternOptions); | ||||
1777 | } | 1778 | } | ||
1778 | 1779 | | |||
1779 | if (escapeSequences) { | 1780 | if (escapeSequences) { | ||
1780 | // escaped search | 1781 | // escaped search | ||
1781 | KatePlainTextSearch searcher(this, caseSensitivity, wholeWords); | 1782 | KatePlainTextSearch searcher(this, caseSensitivity, wholeWords); | ||
1782 | KTextEditor::Range match = searcher.search(KateRegExpSearch::escapePlaintext(pattern), range, backwards); | 1783 | KTextEditor::Range match = searcher.search(KateRegExpSearch::escapePlaintext(pattern), range, backwards); | ||
1783 | 1784 | | |||
1784 | QVector<KTextEditor::Range> result; | 1785 | QVector<KTextEditor::Range> result; | ||
▲ Show 20 Lines • Show All 4296 Lines • Show Last 20 Lines |