Enable visibility of selection on find

Fix #5380
This commit is contained in:
Cristian Maglie 2016-09-20 15:31:17 +02:00
parent c5a6a44b55
commit 1efa07f010
2 changed files with 5 additions and 3 deletions

View File

@ -31,6 +31,7 @@ package cc.arduino.view.findreplace;
import processing.app.Base;
import processing.app.Editor;
import processing.app.EditorTab;
import processing.app.helpers.OSUtils;
import java.awt.*;
@ -355,8 +356,10 @@ public class FindReplace extends javax.swing.JFrame {
}
if (nextIndex != -1) {
editor.getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(nextIndex);
editor.getCurrentTab().setSelection(nextIndex, nextIndex + search.length());
EditorTab currentTab = editor.getCurrentTab();
currentTab.getTextArea().getFoldManager().ensureOffsetNotInClosedFold(nextIndex);
currentTab.setSelection(nextIndex, nextIndex + search.length());
currentTab.getTextArea().getCaret().setSelectionVisible(true);
return true;
}

View File

@ -175,7 +175,6 @@ public class EditorTab extends JPanel implements SketchFile.TextStorage {
editor.lineStatus.set(lineStart, lineEnd);
});
ToolTipManager.sharedInstance().registerComponent(textArea);
configurePopupMenu(textArea);