@@ -4682,7 +4682,7 @@ fn replace_selections_with_primary_clipboard(cx: &mut Context) {
46824682 let _ = replace_selections_with_clipboard_impl(cx.editor, ClipboardType::Selection, cx.count());
46834683}
46844684
4685−fn paste_after(cx: &mut Context) {
4685+fn paste(cx: &mut Context, pos: Paste) {
46864686 let count = cx.count();
46874687 let reg_name = cx.register.unwrap_or('"');
46884688 let (view, doc) = current!(cx.editor);
@@ -4690,24 +4690,18 @@ fn paste_after(cx: &mut Context) {
46904690
46914691 if let Some(transaction) = registers
46924692 .read(reg_name)
4693− .and_then(|values| paste_impl(values, doc, view, Paste::After, count))
4693+ .and_then(|values| paste_impl(values, doc, view, pos, count))
46944694 {
46954695 doc.apply(&transaction, view.id);
46964696 }
46974697}
46984698
4699−fn paste_before(cx: &mut Context) {
4700− let count = cx.count();
4701− let reg_name = cx.register.unwrap_or('"');
4702− let (view, doc) = current!(cx.editor);
4703− let registers = &mut cx.editor.registers;
4699+fn paste_after(cx: &mut Context) {
4700+ paste(cx, Paste::After)
4701+}
47044702
4705− if let Some(transaction) = registers
4706− .read(reg_name)
4707− .and_then(|values| paste_impl(values, doc, view, Paste::Before, count))
4708− {
4709− doc.apply(&transaction, view.id);
4710− }
4703+fn paste_before(cx: &mut Context) {
4704+ paste(cx, Paste::Before)
47114705}
47124706
47134707fn get_lines(doc: &Document, view_id: ViewId) -> Vec<usize> {