Skip to content

Commit 2f7690b

Browse files
committed
Refresh 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.
1 parent 0ee2061 commit 2f7690b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

helix-term/src/commands/typed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@ fn language(
12541254

12551255
let doc = doc_mut!(cx.editor);
12561256
doc.set_language_by_language_id(&args[0], cx.editor.syn_loader.clone());
1257+
doc.detect_indent_and_line_ending();
12571258

12581259
let id = doc.id();
12591260
cx.editor.refresh_language_server(id);

0 commit comments

Comments
 (0)