From b824e091a948c076a428fb981cd5be2929378533 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 12 Nov 2021 20:15:41 -0800 Subject: helix-term/commands: move SCRATCH_BUFFER_NAME to helix-view/document (#1091) This way, the name is accessible everywhere `Document` and related types are.--- helix-term/src/commands.rs | 4 +--- helix-view/src/document.rs | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 48fd0ee0..d5a48c5f 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -13,7 +13,7 @@ use helix_core::{ use helix_view::{ clipboard::ClipboardType, - document::Mode, + document::{Mode, SCRATCH_BUFFER_NAME}, editor::{Action, Motion}, input::KeyEvent, keyboard::KeyCode, @@ -53,8 +53,6 @@ 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, pub count: Option, diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 80f6a740..6b429151 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -25,6 +25,8 @@ const BUF_SIZE: usize = 8192; const DEFAULT_INDENT: IndentStyle = IndentStyle::Spaces(4); +pub const SCRATCH_BUFFER_NAME: &str = "[scratch]"; + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Mode { Normal, -- cgit v1.2.3-70-g09d2