Skip to content

Commit

Permalink
Don't run auto-format immediately on document load, by @gsantner
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Mar 21, 2022
1 parent dedb044 commit 6014327
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,10 @@ public void loadDocument() {
sel[0] = Math.min(sel[0], content.length());
sel[1] = Math.min(sel[1], content.length());

_hlEditor.setAutoFormatEnabled(false);
_hlEditor.setText(content);

_hlEditor.setSelection(sel[0], sel[1]); // hleditor can handle invalid selections
_hlEditor.setAutoFormatEnabled(autoFormat);
}

checkTextChangeState();
Expand Down Expand Up @@ -756,7 +757,9 @@ public void onFragmentFirstTimeVisible() {
if (!initPreview) {
_hlEditor.requestFocus();
}
_hlEditor.setAutoFormatEnabled(false);
_hlEditor.setSelection(_hlEditor.length());
_hlEditor.setAutoFormatEnabled(autoFormat);
}
}
}
Expand Down

0 comments on commit 6014327

Please sign in to comment.