From 19f2f9cc28c6eb8529108b0ddad95419c3949c29 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 7 Dec 2012 19:27:24 -0500 Subject: [PATCH] Fix clobbering of output on cp Closes #10. --- plugin/foreplay.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/foreplay.vim b/plugin/foreplay.vim index 307cf93..596cece 100644 --- a/plugin/foreplay.vim +++ b/plugin/foreplay.vim @@ -426,11 +426,16 @@ function! s:filterop(type) abort endfunction function! s:printop(type) abort + let s:todo = s:opfunc(a:type) + call feedkeys("\ForeplayPrintLast") +endfunction + +function! s:print_last() abort try - echo foreplay#eval(s:opfunc(a:type)) + echo foreplay#eval(s:todo) catch /^Clojure:/ - return '' endtry + return '' endfunction function! s:editop(type) abort @@ -563,6 +568,7 @@ function! s:histswap(list) return old endfunction +nnoremap ForeplayPrintLast :exe print_last() nnoremap ForeplayPrint :set opfunc=printopg@ xnoremap ForeplayPrint :call printop(visualmode())