Skip to content

Commit 1efa07f

Browse files
committed
Enable visibility of selection on find
Fix #5380
1 parent c5a6a44 commit 1efa07f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/src/cc/arduino/view/findreplace/FindReplace.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import processing.app.Base;
3333
import processing.app.Editor;
34+
import processing.app.EditorTab;
3435
import processing.app.helpers.OSUtils;
3536

3637
import java.awt.*;
@@ -355,8 +356,10 @@ private boolean find(boolean wrap, boolean backwards, boolean searchTabs, int or
355356
}
356357

357358
if (nextIndex != -1) {
358-
editor.getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(nextIndex);
359-
editor.getCurrentTab().setSelection(nextIndex, nextIndex + search.length());
359+
EditorTab currentTab = editor.getCurrentTab();
360+
currentTab.getTextArea().getFoldManager().ensureOffsetNotInClosedFold(nextIndex);
361+
currentTab.setSelection(nextIndex, nextIndex + search.length());
362+
currentTab.getTextArea().getCaret().setSelectionVisible(true);
360363
return true;
361364
}
362365

app/src/processing/app/EditorTab.java

-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ private SketchTextArea createTextArea(RSyntaxDocument document)
175175

176176
editor.lineStatus.set(lineStart, lineEnd);
177177
});
178-
179178
ToolTipManager.sharedInstance().registerComponent(textArea);
180179

181180
configurePopupMenu(textArea);

0 commit comments

Comments
 (0)