Skip to content

Commit

Permalink
Detect indent-style in :set-language (#3330)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
the-mikedavis authored Aug 5, 2022
1 parent ee1214d commit f32c05d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f32c05d

Please sign in to comment.