diff --git a/crates/vim/src/normal.rs b/crates/vim/src/normal.rs index e53e2306d6f14b1c230ea383103bdf67fe8196c0..aee0b424f04d49cc634048bb64f95805beef8455 100644 --- a/crates/vim/src/normal.rs +++ b/crates/vim/src/normal.rs @@ -3,7 +3,7 @@ mod convert; mod delete; mod increment; pub(crate) mod mark; -mod paste; +pub(crate) mod paste; pub(crate) mod repeat; mod scroll; pub(crate) mod search; diff --git a/crates/vim/src/normal/paste.rs b/crates/vim/src/normal/paste.rs index 77305ea783c34e340a7ed840658088f3e6191abb..dffabde8fd84081762d7cb62bfa14a2f4ab4a59d 100644 --- a/crates/vim/src/normal/paste.rs +++ b/crates/vim/src/normal/paste.rs @@ -18,7 +18,7 @@ use crate::{ }; /// Pastes text from the specified register at the cursor position. -#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)] +#[derive(Clone, Default, Deserialize, JsonSchema, PartialEq, Action)] #[action(namespace = vim)] #[serde(deny_unknown_fields)] pub struct Paste { diff --git a/crates/vim/src/vim.rs b/crates/vim/src/vim.rs index b633c9ef3c5aa13286277d602ec08efc3ab03373..9f31b3d3ac0c23457d585990de3a0b201f08b795 100644 --- a/crates/vim/src/vim.rs +++ b/crates/vim/src/vim.rs @@ -19,6 +19,7 @@ mod state; mod surrounds; mod visual; +use crate::normal::paste::Paste as VimPaste; use collections::HashMap; use editor::{ Anchor, Bias, Editor, EditorEvent, EditorSettings, HideMouseCursorOrigin, MultiBufferOffset, @@ -922,6 +923,9 @@ impl Vim { cx, |vim, _: &editor::actions::Paste, window, cx| match vim.mode { Mode::Replace => vim.paste_replace(window, cx), + Mode::Visual | Mode::VisualLine | Mode::VisualBlock => { + vim.paste(&VimPaste::default(), window, cx); + } _ => { vim.update_editor(cx, |_, editor, cx| editor.paste(&Paste, window, cx)); }