aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 24c38dd5..23b385eb 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -53,6 +53,8 @@ use grep_searcher::{sinks, BinaryDetection, SearcherBuilder};
use ignore::{DirEntry, WalkBuilder, WalkState};
use tokio_stream::wrappers::UnboundedReceiverStream;
+pub const SCRATCH_BUFFER_NAME: &str = "[scratch]";
+
pub struct Context<'a> {
pub register: Option<char>,
pub count: Option<NonZeroUsize>,
@@ -1890,7 +1892,7 @@ mod cmd {
.map(|doc| {
doc.relative_path()
.map(|path| path.to_string_lossy().to_string())
- .unwrap_or_else(|| "[scratch]".into())
+ .unwrap_or_else(|| SCRATCH_BUFFER_NAME.into())
})
.collect();
if !modified.is_empty() {
@@ -2616,7 +2618,7 @@ fn buffer_picker(cx: &mut Context) {
.map(helix_core::path::get_relative_path);
let path = match path.as_deref().and_then(Path::to_str) {
Some(path) => path,
- None => return Cow::Borrowed("[scratch buffer]"),
+ None => return Cow::Borrowed(SCRATCH_BUFFER_NAME),
};
let mut flags = Vec::new();