Skip to content
GitLab
Menu
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
5b5fbf9b
Commit
5b5fbf9b
authored
Jan 03, 2021
by
Waqar Ahmed
Browse files
Make sure bold characters are not just randomly highlighted
parent
387b0088
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/katequickopen.cpp
View file @
5b5fbf9b
...
...
@@ -97,9 +97,14 @@ public:
QTextDocument
doc
;
QString
str
=
index
.
data
().
toString
();
for
(
const
auto
c
:
m_filterString
)
{
const
QRegularExpression
re
(
QStringLiteral
(
"("
)
+
QRegularExpression
::
escape
(
c
)
+
QStringLiteral
(
")"
),
QRegularExpression
::
CaseInsensitiveOption
);
str
.
replace
(
re
,
QStringLiteral
(
"<b>
\\
1</b>"
));
int
j
=
0
;
for
(
int
i
=
0
;
i
<
str
.
size
()
&&
j
<
m_filterString
.
size
();
++
i
)
{
if
(
str
.
at
(
i
)
==
m_filterString
.
at
(
j
))
{
str
.
replace
(
i
,
1
,
QStringLiteral
(
"<b>"
)
+
str
.
at
(
i
)
+
QStringLiteral
(
"</b>"
));
i
+=
7
;
++
j
;
}
}
doc
.
setHtml
(
str
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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