From c927237912ae5d43b63ea49672735613e6919fad Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 19 Sep 2016 11:20:19 +0200 Subject: [PATCH] Fix tab order in FindReplace When searching through all tabs, the order was accidentally reversed. This was broken by commit d2bac86 (Remove tab switching logic from Sketch). This also fixes a problem where "replace all" would only work on the first and last tab (since it would search backwards from the first tab to the last tab and then conclude it was done). This fixes a part of #5380. --- app/src/cc/arduino/view/findreplace/FindReplace.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/cc/arduino/view/findreplace/FindReplace.java b/app/src/cc/arduino/view/findreplace/FindReplace.java index f5e6a81f184..60dd6626a5e 100644 --- a/app/src/cc/arduino/view/findreplace/FindReplace.java +++ b/app/src/cc/arduino/view/findreplace/FindReplace.java @@ -345,12 +345,12 @@ private boolean find(boolean wrap, boolean backwards, boolean searchTabs, int or } if (backwards) { - editor.selectNextTab(); + editor.selectPrevTab(); this.setVisible(true); int l = editor.getCurrentTab().getText().length() - 1; editor.getCurrentTab().setSelection(l, l); } else { - editor.selectPrevTab(); + editor.selectNextTab(); this.setVisible(true); editor.getCurrentTab().setSelection(0, 0); }