@@ -53,6 +53,8 @@ use grep_searcher::{sinks, BinaryDetection, SearcherBuilder};
53use ignore::{DirEntry, WalkBuilder, WalkState};
53use ignore::{DirEntry, WalkBuilder, WalkState};
54use tokio_stream::wrappers::UnboundedReceiverStream;
54use tokio_stream::wrappers::UnboundedReceiverStream;
56+pub const SCRATCH_BUFFER_NAME: &str = "[scratch]";
56pub struct Context<'a> {
58pub struct Context<'a> {
57 pub register: Option<char>,
59 pub register: Option<char>,
58 pub count: Option<NonZeroUsize>,
60 pub count: Option<NonZeroUsize>,
@@ -1890,7 +1892,7 @@ mod cmd {
1890 .map(|doc| {
1892 .map(|doc| {
1891 doc.relative_path()
1893 doc.relative_path()
1892 .map(|path| path.to_string_lossy().to_string())
1894 .map(|path| path.to_string_lossy().to_string())
1893− .unwrap_or_else(|| "[scratch]".into())
1895+ .unwrap_or_else(|| SCRATCH_BUFFER_NAME.into())
1895 .collect();
1897 .collect();
1896 if !modified.is_empty() {
1898 if !modified.is_empty() {
@@ -2616,7 +2618,7 @@ fn buffer_picker(cx: &mut Context) {
2616 .map(helix_core::path::get_relative_path);
2618 .map(helix_core::path::get_relative_path);
2617 let path = match path.as_deref().and_then(Path::to_str) {
2619 let path = match path.as_deref().and_then(Path::to_str) {
2618 Some(path) => path,
2620 Some(path) => path,
2619− None => return Cow::Borrowed("[scratch buffer]"),
2621+ None => return Cow::Borrowed(SCRATCH_BUFFER_NAME),
2622 let mut flags = Vec::new();
2624 let mut flags = Vec::new();