diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index e84d244b1..14638d2b8 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -488,8 +488,8 @@ impl MappableCommand { replace_with_yanked, "Replace with yanked text", replace_selections_with_clipboard, "Replace selections by clipboard content", replace_selections_with_primary_clipboard, "Replace selections by primary clipboard", - paste_after_all, "Paste all after selection", - paste_before_all, "Paste all before selection", + paste_all_selections_after, "Paste all after selection", + paste_all_selections_before, "Paste all before selection", paste_after, "Paste after selection", paste_before, "Paste before selection", paste_clipboard_after, "Paste clipboard after selections", @@ -4870,23 +4870,25 @@ fn paste(editor: &mut Editor, register: char, pos: Paste, count: usize, paste_ty paste_impl(&values, doc, view, pos, count, editor.mode, paste_type); } -fn paste_after_all(cx: &mut Context) { +fn paste_all_selections_after(cx: &mut Context) { paste( - cx, + cx.editor, cx.register .unwrap_or(cx.editor.config().default_yank_register), Paste::After, + cx.count(), PasteType::All, ); exit_select_mode(cx); } -fn paste_before_all(cx: &mut Context) { +fn paste_all_selections_before(cx: &mut Context) { paste( - cx, + cx.editor, cx.register .unwrap_or(cx.editor.config().default_yank_register), Paste::Before, + cx.count(), PasteType::All, ); exit_select_mode(cx); diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 2013a9d81..12a2b1e5a 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1039,7 +1039,7 @@ fn paste_clipboard_after( return Ok(()); } - paste(cx.editor, '+', Paste::After, 1); + paste(cx.editor, '+', Paste::After, 1, PasteType::Default); Ok(()) } @@ -1052,7 +1052,7 @@ fn paste_clipboard_before( return Ok(()); } - paste(cx.editor, '+', Paste::Before, 1); + paste(cx.editor, '+', Paste::Before, 1, PasteType::Default); Ok(()) } @@ -1065,7 +1065,7 @@ fn paste_primary_clipboard_after( return Ok(()); } - paste(cx.editor, '*', Paste::After, 1); + paste(cx.editor, '*', Paste::After, 1, PasteType::Default); Ok(()) } @@ -1078,7 +1078,7 @@ fn paste_primary_clipboard_before( return Ok(()); } - paste(cx.editor, '*', Paste::Before, 1); + paste(cx.editor, '*', Paste::Before, 1, PasteType::Default); Ok(()) } diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs index ad856ce0e..38d65558f 100644 --- a/helix-term/src/keymap/default.rs +++ b/helix-term/src/keymap/default.rs @@ -153,9 +153,9 @@ pub fn default() -> HashMap { // yank_all "p" => paste_after, // TODO: This is a terrible mapping, but "A-p" coincides with "select_prev_sibling" - "C-p" => paste_after_all, + "C-p" => paste_all_selections_after, "P" => paste_before, - "A-P" => paste_before_all, + "A-P" => paste_all_selections_before, "Q" => record_macro, "q" => replay_macro,