Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
e30d39f8
Commit
e30d39f8
authored
Jul 26, 2022
by
Waqar Ahmed
Browse files
Search: Dont enable multiline search when regex mode is disabled
BUG: 457146
parent
81a99c39
Pipeline
#215595
passed with stage
in 6 minutes and 17 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
addons/search/SearchDiskFiles.cpp
View file @
e30d39f8
...
...
@@ -24,7 +24,7 @@ SearchDiskFiles::SearchDiskFiles(SearchDiskFilesWorkList &worklist, const QRegul
void
SearchDiskFiles
::
run
()
{
// do we need to search multiple lines?
const
bool
multiLineSearch
=
m_regExp
.
pattern
().
contains
(
QLatin1String
(
"
\\
n"
));
const
bool
multiLineSearch
=
m_regExp
.
patternOptions
().
testFlag
(
QRegularExpression
::
MultilineOption
)
&&
m_regExp
.
pattern
().
contains
(
QLatin1String
(
"
\\
n"
));
// timer to emit matchesFound once in a time even for files without matches
// this triggers process in the UI
...
...
addons/search/SearchOpenFiles.cpp
View file @
e30d39f8
...
...
@@ -86,7 +86,7 @@ int SearchOpenFiles::searchOpenFile(KTextEditor::Document *doc, const QRegularEx
Q_EMIT
searching
(
doc
->
url
().
toString
());
}
if
(
regExp
.
pattern
().
contains
(
QLatin1String
(
"
\\
n"
)))
{
if
(
regExp
.
patternOptions
().
testFlag
(
QRegularExpression
::
MultilineOption
)
&&
regExp
.
pattern
().
contains
(
QLatin1String
(
"
\\
n"
)))
{
return
searchMultiLineRegExp
(
doc
,
regExp
,
startLine
);
}
...
...
addons/search/SearchPlugin.cpp
View file @
e30d39f8
...
...
@@ -987,7 +987,7 @@ void KatePluginSearchView::startSearch()
patternOptions
|=
QRegularExpression
::
CaseInsensitiveOption
;
}
if
(
pattern
.
contains
(
QLatin1String
(
"
\\
n"
)))
{
if
(
m_ui
.
useRegExp
->
isChecked
()
&&
pattern
.
contains
(
QLatin1String
(
"
\\
n"
)))
{
patternOptions
|=
QRegularExpression
::
MultilineOption
;
}
QRegularExpression
reg
(
pattern
,
patternOptions
);
...
...
@@ -1166,7 +1166,7 @@ void KatePluginSearchView::startSearchWhileTyping()
if
(
!
m_ui
.
matchCase
->
isChecked
())
{
patternOptions
|=
QRegularExpression
::
CaseInsensitiveOption
;
}
if
(
pattern
.
contains
(
QLatin1String
(
"
\\
n"
)))
{
if
(
m_curResults
->
useRegExp
&&
pattern
.
contains
(
QLatin1String
(
"
\\
n"
)))
{
patternOptions
|=
QRegularExpression
::
MultilineOption
;
}
QRegularExpression
reg
(
pattern
,
patternOptions
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment