@@ -139,6 +139,7 @@ where
139 match element_id {
139 match element_id {
140 helix_view::editor::StatusLineElement::Mode => render_mode,
140 helix_view::editor::StatusLineElement::Mode => render_mode,
141 helix_view::editor::StatusLineElement::Spinner => render_lsp_spinner,
141 helix_view::editor::StatusLineElement::Spinner => render_lsp_spinner,
142+ helix_view::editor::StatusLineElement::FileBaseName => render_file_base_name,
142 helix_view::editor::StatusLineElement::FileName => render_file_name,
143 helix_view::editor::StatusLineElement::FileName => render_file_name,
143 helix_view::editor::StatusLineElement::FileEncoding => render_file_encoding,
144 helix_view::editor::StatusLineElement::FileEncoding => render_file_encoding,
144 helix_view::editor::StatusLineElement::FileLineEnding => render_file_line_ending,
145 helix_view::editor::StatusLineElement::FileLineEnding => render_file_line_ending,
@@ -426,6 +427,26 @@ where
426 write(context, title, None);
427 write(context, title, None);
430+fn render_file_base_name<F>(context: &mut RenderContext, write: F)
432+ F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
435+ let rel_path = context.doc.relative_path();
438+ .and_then(|p| p.as_path().file_name().map(|s| s.to_string_lossy()))
439+ .unwrap_or_else(|| SCRATCH_BUFFER_NAME.into());
443+ if context.doc.is_modified() { "[+]" } else { "" }
447+ write(context, title, None);
429fn render_separator<F>(context: &mut RenderContext, write: F)
450fn render_separator<F>(context: &mut RenderContext, write: F)
431 F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
452 F: Fn(&mut RenderContext, String, Option<Style>) + Copy,