diff --git a/app/src/processing/app/Sketch.java b/app/src/processing/app/Sketch.java index 7de129474..40a3d7fb2 100644 --- a/app/src/processing/app/Sketch.java +++ b/app/src/processing/app/Sketch.java @@ -1404,8 +1404,8 @@ public class Sketch { // System.out.println(current.visited); // } // if current is null, then this is the first setCurrent(0) - if (((currentIndex == which) && (current != null)) - || which >= codeCount || which < 0) { + if (which < 0 || which >= codeCount || + ((currentIndex == which) && (current == code[currentIndex]))) { return; } diff --git a/app/src/processing/app/ui/ChangeDetector.java b/app/src/processing/app/ui/ChangeDetector.java index 2bad61f80..024c2aa58 100644 --- a/app/src/processing/app/ui/ChangeDetector.java +++ b/app/src/processing/app/ui/ChangeDetector.java @@ -215,8 +215,7 @@ public class ChangeDetector implements WindowFocusListener { ); } editor.rebuildHeader(); - sketch.handleNextCode(); - sketch.handlePrevCode(); + sketch.setCurrentCode(sketch.getCurrentCodeIndex()); editor.repaintHeader(); editor.sketchChanged();