From 06f62c9f5170191557b8a7b8b3c822af7876f8fa Mon Sep 17 00:00:00 2001 From: Tom McDonald Date: Sat, 26 Apr 2014 08:25:46 -0400 Subject: [PATCH] Ensure 'selection' is set to inclusive References #23. --- plugin/exchange.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/exchange.vim b/plugin/exchange.vim index dd2ba61..44b10b8 100644 --- a/plugin/exchange.vim +++ b/plugin/exchange.vim @@ -3,6 +3,8 @@ function! s:exchange(x, y, reverse) let reg_z_mode = getregtype('z') let reg_unnamed = getreg('"') let reg_unnamed_mode = getregtype('"') + let selection = &selection + set selection=inclusive call setpos("'[", a:y[2]) 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]) endif + let &selection = selection call setreg('z', reg_z, reg_z_mode) call setreg('"', reg_unnamed, reg_unnamed_mode) endfunction