Skip to content

Commit 9723726

Browse files
committed
Call ensureOffsetNotInClosedFold only when a match is found
1 parent c927237 commit 9723726

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ private boolean find(boolean wrap, boolean backwards, boolean searchTabs, int or
323323
}
324324
}
325325

326-
editor.getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(nextIndex);
327-
328326
if (nextIndex == -1) {
329327
// Nothing found on this tab: Search other tabs if required
330328
if (searchTabs) {
@@ -366,6 +364,7 @@ private boolean find(boolean wrap, boolean backwards, boolean searchTabs, int or
366364
}
367365

368366
if (nextIndex != -1) {
367+
editor.getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(nextIndex);
369368
editor.getCurrentTab().setSelection(nextIndex, nextIndex + search.length());
370369
return true;
371370
}

0 commit comments

Comments
 (0)