@@ -16,7 +16,7 @@ use helix_core::{
16 LineEnding, Position, Range, Selection,
16 LineEnding, Position, Range, Selection,
18use helix_view::{
18use helix_view::{
19− document::Mode,
19+ document::{Mode, SCRATCH_BUFFER_NAME},
20 editor::LineNumber,
20 editor::LineNumber,
21 graphics::{CursorKind, Modifier, Rect, Style},
21 graphics::{CursorKind, Modifier, Rect, Style},
22 info::Info,
22 info::Info,
@@ -580,18 +580,20 @@ impl EditorView {
581 surface.set_string(viewport.x + 5, viewport.y, progress, base_style);
581 surface.set_string(viewport.x + 5, viewport.y, progress, base_style);
583− if let Some(path) = doc.relative_path() {
583+ let rel_path = doc.relative_path();
584− let path = path.to_string_lossy();
586+ .map(|p| p.to_string_lossy())
587+ .unwrap_or_else(|| SCRATCH_BUFFER_NAME.into());
586− let title = format!("{}{}", path, if doc.is_modified() { "[+]" } else { "" });
589+ let title = format!("{}{}", path, if doc.is_modified() { "[+]" } else { "" });
587− surface.set_stringn(
590+ surface.set_stringn(
588− viewport.x + 8,
591+ viewport.x + 8,
589− viewport.y,
592+ viewport.y,
591− viewport.width.saturating_sub(6) as usize,
594+ viewport.width.saturating_sub(6) as usize,
592− base_style,
595+ base_style,
596 //-------------------------------
598 //-------------------------------
597 // Right side of the status line.
599 // Right side of the status line.