Fix clobbering of output on cp

Closes #10.
This commit is contained in:
Tim Pope 2012-12-07 19:27:24 -05:00
parent 9161a36da0
commit 19f2f9cc28
1 changed files with 8 additions and 2 deletions

View File

@ -426,11 +426,16 @@ function! s:filterop(type) abort
endfunction endfunction
function! s:printop(type) abort function! s:printop(type) abort
let s:todo = s:opfunc(a:type)
call feedkeys("\<Plug>ForeplayPrintLast")
endfunction
function! s:print_last() abort
try try
echo foreplay#eval(s:opfunc(a:type)) echo foreplay#eval(s:todo)
catch /^Clojure:/ catch /^Clojure:/
return ''
endtry endtry
return ''
endfunction endfunction
function! s:editop(type) abort function! s:editop(type) abort
@ -563,6 +568,7 @@ function! s:histswap(list)
return old return old
endfunction endfunction
nnoremap <silent> <Plug>ForeplayPrintLast :exe <SID>print_last()<CR>
nnoremap <silent> <Plug>ForeplayPrint :<C-U>set opfunc=<SID>printop<CR>g@ nnoremap <silent> <Plug>ForeplayPrint :<C-U>set opfunc=<SID>printop<CR>g@
xnoremap <silent> <Plug>ForeplayPrint :<C-U>call <SID>printop(visualmode())<CR> xnoremap <silent> <Plug>ForeplayPrint :<C-U>call <SID>printop(visualmode())<CR>