Fix c!! with selection=inclusive

References #110.
This commit is contained in:
Tim Pope 2014-04-03 16:23:13 -04:00
parent 90b909b9f4
commit d65eaa5068

View File

@ -731,7 +731,10 @@ endfunction
function! s:filterop(type) abort function! s:filterop(type) abort
let reg_save = @@ let reg_save = @@
let sel_save = &selection
let cb_save = &clipboard
try try
set selection=inclusive clipboard-=unnamed clipboard-=unnamedplus
let expr = s:opfunc(a:type) let expr = s:opfunc(a:type)
let @@ = matchstr(expr, '^\n\+').fireplace#session_eval(expr).matchstr(expr, '\n\+$') let @@ = matchstr(expr, '^\n\+').fireplace#session_eval(expr).matchstr(expr, '\n\+$')
if @@ !~# '^\n*$' if @@ !~# '^\n*$'
@ -741,6 +744,8 @@ function! s:filterop(type) abort
return '' return ''
finally finally
let @@ = reg_save let @@ = reg_save
let &selection = sel_save
let &clipboard = cb_save
endtry endtry
endfunction endfunction