aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-05-07 15:39:55 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-05-07 15:39:55 -0500
commitec85152530db6fc1aaaea27add80558109bdc031 (patch)
treedfbd69291afd74f29a0324900b280477d60bbfd4
parentec15948e92f0ab5ea682c8c8bbc3117efc1dec1d (diff)
downloadvim-textobj-ec85152530db6fc1aaaea27add80558109bdc031.tar.gz
vim-textobj-ec85152530db6fc1aaaea27add80558109bdc031.zip
subtract 1 from the length rather than backspacing afterwards in visual mode
-rw-r--r--vim/plugin/textobj.vim5
1 files changed, 3 insertions, 2 deletions
diff --git a/vim/plugin/textobj.vim b/vim/plugin/textobj.vim
index d6cde6b..e60abd8 100644
--- a/vim/plugin/textobj.vim
+++ b/vim/plugin/textobj.vim
@@ -32,6 +32,9 @@ function Textobj(char, callback)
if endcol == 0
set virtualedit=onemore
endif
+ if a:operator == 'v'
+ let objlength -= 1
+ endif
call cursor(startline, startcol)
if a:operator == 'c'
let operator = 'd'
@@ -42,8 +45,6 @@ function Textobj(char, callback)
if a:operator == 'c'
startinsert
- elseif a:operator == 'v'
- exe "normal! \<BS>"
endif
let &whichwrap = whichwrap
let &virtualedit = virtualedit