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
6f262719
Commit
6f262719
authored
Jan 18, 2021
by
Kåre Särs
Browse files
Fix empty tree node on startup
+ fix variable naming
parent
01f5001f
Changes
3
Hide whitespace changes
Inline
Side-by-side
addons/search/MatchModel.cpp
View file @
6f262719
...
...
@@ -975,7 +975,7 @@ Qt::ItemFlags MatchModel::flags(const QModelIndex &index) const
int
MatchModel
::
rowCount
(
const
QModelIndex
&
parent
)
const
{
if
(
!
parent
.
isValid
())
{
return
/*
m_matchFiles.isEmpty() && m_searchState == SearchDone ? 0 :
*/
1
;
return
(
m_matchFiles
.
isEmpty
()
&&
m_searchState
==
SearchDone
)
?
0
:
1
;
}
if
(
parent
.
internalId
()
==
InfoItemId
)
{
...
...
addons/search/plugin_search.cpp
View file @
6f262719
...
...
@@ -797,12 +797,12 @@ void KatePluginSearchView::updateSearchColors()
if
(
!
lineNrBackgroundColor
.
isValid
())
lineNrBackgroundColor
=
view
->
defaultStyleAttribute
(
KTextEditor
::
dsNormal
)
->
background
().
color
();
if
(
!
resultAttr
)
resultAttr
=
new
KTextEditor
::
Attribute
();
if
(
!
m_
resultAttr
)
m_
resultAttr
=
new
KTextEditor
::
Attribute
();
// reset colors at the start of search
resultAttr
->
clear
();
resultAttr
->
setBackground
(
searchBackgroundColor
);
resultAttr
->
setForeground
(
foregroundColor
);
m_
resultAttr
->
clear
();
m_
resultAttr
->
setBackground
(
searchBackgroundColor
);
m_
resultAttr
->
setForeground
(
foregroundColor
);
if
(
m_curResults
)
{
auto
*
delegate
=
qobject_cast
<
SPHtmlDelegate
*>
(
m_curResults
->
treeView
->
itemDelegate
());
...
...
@@ -1443,7 +1443,7 @@ void KatePluginSearchView::updateMatchMarks()
// Add match marks for all matches in the file
const
QVector
<
KateSearchMatch
>
&
fileMatches
=
res
->
matchModel
.
fileMatches
(
doc
->
url
());
for
(
const
KateSearchMatch
&
match
:
fileMatches
)
{
addRangeAndMark
(
doc
,
match
,
resultAttr
,
miface
);
addRangeAndMark
(
doc
,
match
,
m_
resultAttr
,
miface
);
}
}
...
...
addons/search/plugin_search.h
View file @
6f262719
...
...
@@ -201,7 +201,7 @@ private:
QTimer
m_changeTimer
;
QPointer
<
KTextEditor
::
Message
>
m_infoMessage
;
QColor
m_replaceHighlightColor
;
KTextEditor
::
Attribute
::
Ptr
resultAttr
;
KTextEditor
::
Attribute
::
Ptr
m_
resultAttr
;
/**
* current project plugin view, if any
...
...
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