@@ -139,6 +139,7 @@ where
139139 match element_id {
140140 helix_view::editor::StatusLineElement::Mode => render_mode,
141141 helix_view::editor::StatusLineElement::Spinner => render_lsp_spinner,
142+ helix_view::editor::StatusLineElement::FileBaseName => render_file_base_name,
142143 helix_view::editor::StatusLineElement::FileName => render_file_name,
143144 helix_view::editor::StatusLineElement::FileEncoding => render_file_encoding,
144145 helix_view::editor::StatusLineElement::FileLineEnding => render_file_line_ending,
@@ -426,6 +427,26 @@ where
426427 write(context, title, None);
427428}
428429
430+fn render_file_base_name<F>(context: &mut RenderContext, write: F)
431+where
432+ F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
433+{
434+ let title = {
435+ let rel_path = context.doc.relative_path();
436+ let path = rel_path
437+ .as_ref()
438+ .and_then(|p| p.as_path().file_name().map(|s| s.to_string_lossy()))
439+ .unwrap_or_else(|| SCRATCH_BUFFER_NAME.into());
440+ format!(
441+ " {}{} ",
442+ path,
443+ if context.doc.is_modified() { "[+]" } else { "" }
444+ )
445+ };
446+
447+ write(context, title, None);
448+}
449+
429450fn render_separator<F>(context: &mut RenderContext, write: F)
430451where
431452 F: Fn(&mut RenderContext, String, Option<Style>) + Copy,