From 886cff3bcc5f8e1d81e55afdbbf7ad8ff00ffc7b Mon Sep 17 00:00:00 2001 From: farwyler <1705805+farwyler@users.noreply.github.com> Date: Fri, 24 Jun 2022 15:56:18 +0200 Subject: [PATCH] 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. --- helix-term/src/commands.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index a07b5109..43bc0c7c 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2343,6 +2343,7 @@ async fn make_format_callback( if doc.version() == doc_version { doc.apply(&Transaction::from(format), view_id); doc.append_changes_to_history(view_id); + doc.detect_indent_and_line_ending(); if let Modified::SetUnmodified = modified { doc.reset_modified(); }