@@ -4682,7 +4682,7 @@ fn replace_selections_with_primary_clipboard(cx: &mut Context) {
4682 let _ = replace_selections_with_clipboard_impl(cx.editor, ClipboardType::Selection, cx.count());
4682 let _ = replace_selections_with_clipboard_impl(cx.editor, ClipboardType::Selection, cx.count());
4685−fn paste_after(cx: &mut Context) {
4685+fn paste(cx: &mut Context, pos: Paste) {
4686 let count = cx.count();
4686 let count = cx.count();
4687 let reg_name = cx.register.unwrap_or('"');
4687 let reg_name = cx.register.unwrap_or('"');
4688 let (view, doc) = current!(cx.editor);
4688 let (view, doc) = current!(cx.editor);
@@ -4690,24 +4690,18 @@ fn paste_after(cx: &mut Context) {
4691 if let Some(transaction) = registers
4691 if let Some(transaction) = registers
4692 .read(reg_name)
4692 .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))
4695 doc.apply(&transaction, view.id);
4695 doc.apply(&transaction, view.id);
4699−fn paste_before(cx: &mut Context) {
4699+fn paste_after(cx: &mut Context) {
4700− let count = cx.count();
4700+ paste(cx, Paste::After)
4701− let reg_name = cx.register.unwrap_or('"');
4701+}
4702− let (view, doc) = current!(cx.editor);
4703− let registers = &mut cx.editor.registers;
4705− if let Some(transaction) = registers
4703+fn paste_before(cx: &mut Context) {
4706− .read(reg_name)
4704+ paste(cx, Paste::Before)
4707− .and_then(|values| paste_impl(values, doc, view, Paste::Before, count))
4709− doc.apply(&transaction, view.id);
4713fn get_lines(doc: &Document, view_id: ViewId) -> Vec<usize> {
4707fn get_lines(doc: &Document, view_id: ViewId) -> Vec<usize> {