diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index bc9c90ef8..1fa6bb5bd 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -613,7 +613,11 @@ public class Base { activeEditor.rebuildRecentSketchesMenu(); if (PreferencesData.getBoolean("editor.external")) { try { + int previousCaretPosition = activeEditor.getTextArea().getCaretPosition(); activeEditor.getSketch().load(true); + if (previousCaretPosition < activeEditor.getText().length()) { + activeEditor.getTextArea().setCaretPosition(previousCaretPosition); + } } catch (IOException e) { // noop }