Skip to content

Commit dceac81

Browse files
committed
Make sure the highlights of previously found matches are cleared before new search.
1 parent 7303319 commit dceac81

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/components/HTMLTextAreaSearchUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ static DocumentSearchResult current(JTextComponent component) {
171171

172172
static DocumentSearchResult get(String search, boolean matchCase, JTextComponent component) {
173173
DocumentSearchResult result = current(component);
174-
if (result != null && result.compatibleSearch(search, matchCase)) return result;
174+
if (result != null) {
175+
if (result.compatibleSearch(search, matchCase)) return result;
176+
else result.clearHighlightedResults(component.getHighlighter());
177+
}
175178

176179
try {
177180
Document document = component.getDocument();

0 commit comments

Comments
 (0)