Skip to content

Commit

Permalink
Re-trigger highlighting when adding or removing favorites (issue #2759)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Jul 19, 2022
1 parent aae0398 commit 98c5b37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/src/search-syntax-highlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ void SearchSyntaxHighlighter::updateFavorites()
merged += QRegularExpression::escape(favorite.getName());
}
m_favoritesRule->pattern.setPattern("(?: |^)(" + merged + ")(?: |$)");

rehighlight();
}

void SearchSyntaxHighlighter::updateKeptForLater()
Expand All @@ -81,6 +83,8 @@ void SearchSyntaxHighlighter::updateKeptForLater()
merged += QRegularExpression::escape(kfl);
}
m_kflRule->pattern.setPattern("(?: |^)(" + merged + ")(?: |$)");

rehighlight();
}

void SearchSyntaxHighlighter::highlightBlock(const QString &text)
Expand Down

0 comments on commit 98c5b37

Please sign in to comment.