Redetect indent and line endings after language server replaces documents (#2778)

* redetect indent and line endings after language server replaces document

* removes nested if

* always redetect indent and line endings after format

This reverts commit 764d14f55894dc7213e48022dfa0f91829b8ef59.
imgbot
farwyler 3 years ago committed by GitHub
parent c107f4ea49
commit 886cff3bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2343,6 +2343,7 @@ async fn make_format_callback(
if doc.version() == doc_version { if doc.version() == doc_version {
doc.apply(&Transaction::from(format), view_id); doc.apply(&Transaction::from(format), view_id);
doc.append_changes_to_history(view_id); doc.append_changes_to_history(view_id);
doc.detect_indent_and_line_ending();
if let Modified::SetUnmodified = modified { if let Modified::SetUnmodified = modified {
doc.reset_modified(); doc.reset_modified();
} }

Loading…
Cancel
Save