helix-view/editor: use SCRATCH_BUFFER_NAME const (#1104)

This commit is contained in:
Cole Helbling 2021-11-15 08:46:39 -08:00 committed by GitHub
parent c95cb2be28
commit 225e7904ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
use crate::{
clipboard::{get_clipboard_provider, ClipboardProvider},
document::SCRATCH_BUFFER_NAME,
graphics::{CursorKind, Rect},
theme::{self, Theme},
tree::{self, Tree},
@ -427,7 +428,7 @@ pub fn close_document(&mut self, doc_id: DocumentId, force: bool) -> anyhow::Res
"buffer {:?} is modified",
doc.relative_path()
.map(|path| path.to_string_lossy().to_string())
.unwrap_or_else(|| "[scratch]".into())
.unwrap_or_else(|| SCRATCH_BUFFER_NAME.into())
);
}