mirror of
https://github.com/nushell/reedline.git
synced 2024-09-11 15:55:50 +03:00
parent
ac1d9549a3
commit
92cb330925
@ -16,20 +16,15 @@ pub trait Clipboard: Send {
|
||||
}
|
||||
|
||||
/// Determines how the content in the clipboard should be inserted
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Copy, Clone, Debug, Default)]
|
||||
pub enum ClipboardMode {
|
||||
/// As direct content at the current cursor position
|
||||
#[default]
|
||||
Normal,
|
||||
/// As new lines below or above
|
||||
Lines,
|
||||
}
|
||||
|
||||
impl Default for ClipboardMode {
|
||||
fn default() -> Self {
|
||||
ClipboardMode::Normal
|
||||
}
|
||||
}
|
||||
|
||||
/// Simple buffer that provides a clipboard only usable within the application/library.
|
||||
#[derive(Default)]
|
||||
pub struct LocalClipboard {
|
||||
|
@ -109,7 +109,7 @@ mod tests {
|
||||
#[cfg(any(feature = "sqlite", feature = "sqlite-dynlib"))]
|
||||
let hist = Box::new(SqliteBackedHistory::in_memory().unwrap());
|
||||
#[cfg(not(any(feature = "sqlite", feature = "sqlite-dynlib")))]
|
||||
let hist = Box::new(FileBackedHistory::default());
|
||||
let hist = Box::<FileBackedHistory>::default();
|
||||
(
|
||||
hist,
|
||||
HistoryCursor::new(HistoryNavigationQuery::Normal(LineBuffer::default())),
|
||||
|
@ -59,21 +59,16 @@ pub enum PromptEditMode {
|
||||
}
|
||||
|
||||
/// The vi-specific modes that the prompt can be in
|
||||
#[derive(Serialize, Deserialize, Clone, Debug, EnumIter)]
|
||||
#[derive(Serialize, Deserialize, Clone, Debug, EnumIter, Default)]
|
||||
pub enum PromptViMode {
|
||||
/// The default mode
|
||||
#[default]
|
||||
Normal,
|
||||
|
||||
/// Insertion mode
|
||||
Insert,
|
||||
}
|
||||
|
||||
impl Default for PromptViMode {
|
||||
fn default() -> Self {
|
||||
PromptViMode::Normal
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for PromptEditMode {
|
||||
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
|
Loading…
Reference in New Issue
Block a user