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
Marco Bubke
flatpak-qt-creator
Commits
c7a1068f
Commit
c7a1068f
authored
Nov 03, 2010
by
con
Browse files
Support \n for regexp replace string.
parent
a82d57de
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/utils/filesearch.cpp
View file @
c7a1068f
...
...
@@ -291,7 +291,7 @@ QFuture<FileSearchResultList> Utils::findInFilesRegExp(const QString &searchTerm
QString
Utils
::
expandRegExpReplacement
(
const
QString
&
replaceText
,
const
QStringList
&
capturedTexts
)
{
// handles \1 \\ \& & \t
// handles \1 \\ \& & \t
\n
QString
result
;
const
int
numCaptures
=
capturedTexts
.
size
()
-
1
;
for
(
int
i
=
0
;
i
<
replaceText
.
length
();
++
i
)
{
...
...
@@ -304,6 +304,8 @@ QString Utils::expandRegExpReplacement(const QString &replaceText, const QString
result
+=
QLatin1Char
(
'&'
);
}
else
if
(
c
==
QLatin1Char
(
't'
))
{
result
+=
QLatin1Char
(
'\t'
);
}
else
if
(
c
==
QLatin1Char
(
'n'
))
{
result
+=
QLatin1Char
(
'\n'
);
}
else
if
(
c
.
isDigit
())
{
int
index
=
c
.
unicode
()
-
'1'
;
if
(
index
<
numCaptures
)
{
...
...
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