mirror of https://github.com/helix-editor/helix
feat(statusline): add the file type (language id) to the status line
parent
b612211070
commit
da5a886cb0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue