From ec85152530db6fc1aaaea27add80558109bdc031 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Wed, 7 May 2008 15:39:55 -0500 Subject: subtract 1 from the length rather than backspacing afterwards in visual mode --- vim/plugin/textobj.vim | 5 +++-- 1 file 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! \" endif let &whichwrap = whichwrap let &virtualedit = virtualedit -- cgit v1.2.3-54-g00ecf