feat(statusline): add the file type (language id) to the status line

pull/2434/head
etienne-k 2022-05-06 23:01:25 +02:00
parent b612211070
commit da5a886cb0
1 changed files with 7 additions and 0 deletions

View File

@ -838,6 +838,7 @@ impl EditorView {
base_style,
));
// Encoding
let enc = doc.encoding();
if enc != encoding::UTF_8 {
right_side_text
@ -845,6 +846,12 @@ impl EditorView {
.push(Span::styled(format!(" {} ", enc.name()), base_style));
}
// File type
let file_type = doc.language_id().unwrap_or("text");
right_side_text
.0
.push(Span::styled(format!(" {} ", file_type), base_style));
// Render to the statusline.
surface.set_spans(
viewport.x