Ensure 'selection' is set to inclusive

References #23.
This commit is contained in:
Tom McDonald 2014-04-26 08:25:46 -04:00
parent 105cf06d43
commit 06f62c9f51

View File

@ -3,6 +3,8 @@ function! s:exchange(x, y, reverse)
let reg_z_mode = getregtype('z') let reg_z_mode = getregtype('z')
let reg_unnamed = getreg('"') let reg_unnamed = getreg('"')
let reg_unnamed_mode = getregtype('"') let reg_unnamed_mode = getregtype('"')
let selection = &selection
set selection=inclusive
call setpos("'[", a:y[2]) call setpos("'[", a:y[2])
call setpos("']", a:y[3]) call setpos("']", a:y[3])
@ -20,6 +22,7 @@ function! s:exchange(x, y, reverse)
call cursor(a:y[2][1], a:y[2][2]) call cursor(a:y[2][1], a:y[2][2])
endif endif
let &selection = selection
call setreg('z', reg_z, reg_z_mode) call setreg('z', reg_z, reg_z_mode)
call setreg('"', reg_unnamed, reg_unnamed_mode) call setreg('"', reg_unnamed, reg_unnamed_mode)
endfunction endfunction