1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-30 19:52:13 +01:00

Call ensureOffsetNotInClosedFold only when a match is found

This commit is contained in:
Cristian Maglie 2016-09-20 13:45:11 +02:00
parent c927237912
commit 9723726387

View File

@ -323,8 +323,6 @@ public class FindReplace extends javax.swing.JFrame {
}
}
editor.getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(nextIndex);
if (nextIndex == -1) {
// Nothing found on this tab: Search other tabs if required
if (searchTabs) {
@ -366,6 +364,7 @@ public class FindReplace extends javax.swing.JFrame {
}
if (nextIndex != -1) {
editor.getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(nextIndex);
editor.getCurrentTab().setSelection(nextIndex, nextIndex + search.length());
return true;
}