Skip to content

Commit

Permalink
Use Document::language_name for the file-type statusline element
Browse files Browse the repository at this point in the history
The `file-type` indicator element in the statusline was using
`Document::language_id` which is meant to be used to for telling
Language Servers what language we're using. That works for languages
with `language-server` configurations in `languages.toml` but shows
text otherwise. The new `Document::language_name` method from the
parent commit is a more accurate way to determine the language.
  • Loading branch information
the-mikedavis committed Aug 5, 2022
1 parent f56f518 commit 726bbef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/ui/statusline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ fn render_file_type<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
{
let file_type = context.doc.language_id().unwrap_or("text");
let file_type = context.doc.language_name().unwrap_or("text");

write(context, format!(" {} ", file_type), None);
}
Expand Down

0 comments on commit 726bbef

Please sign in to comment.