From cd0ed36ade6e35a63f490dfa04e4bb76b419679a Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 4 Aug 2022 12:28:37 -0500 Subject: [PATCH] Detect indent-style in `:set-language` Indent style may change when choosing a language with `:set-language`. Line-endings most likely will not change, but `:set-language` should have a similar effect as reloading a file (`:reload`), plus the two are currently grouped in the implementation and line-ending detection is not particularly expensive. --- helix-term/src/commands/typed.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index dbf7cb243a1f..ad4e7f4ce9da 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1254,6 +1254,7 @@ fn language( let doc = doc_mut!(cx.editor); doc.set_language_by_language_id(&args[0], cx.editor.syn_loader.clone()); + doc.detect_indent_and_line_ending(); let id = doc.id(); cx.editor.refresh_language_server(id);