mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Saving caret position when using external editor, attempting to restore it on window activation. Fixes #4155
This commit is contained in:
parent
a2fe70aba4
commit
d0bd09c8d3
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user