Use setreg() to preserve yanked text's -wise mode

This commit is contained in:
Tom McDonald 2013-12-11 10:03:15 -05:00
parent 07d9946872
commit a0e2169959

View File

@ -6,12 +6,12 @@ function! s:exchange(x, y)
call setpos("'a", a:y[2]) call setpos("'a", a:y[2])
call setpos("'b", a:y[3]) call setpos("'b", a:y[3])
let @@ = a:x[0] call setreg('@', a:x[0], a:x[1])
silent exe "normal! `a" . a:y[1] . "`b\"\"p" silent exe "normal! `a" . a:y[1] . "`b\"\"p"
call setpos("'a", a:x[2]) call setpos("'a", a:x[2])
call setpos("'b", a:x[3]) call setpos("'b", a:x[3])
let @@ = a:y[0] call setreg('@', a:y[0], a:y[1])
silent exe "normal! `a" . a:x[1] . "`b\"\"p" silent exe "normal! `a" . a:x[1] . "`b\"\"p"
call setpos("'a", a) call setpos("'a", a)