aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vimrc17
1 files changed, 9 insertions, 8 deletions
diff --git a/vimrc b/vimrc
index 092c92c..887ccc3 100644
--- a/vimrc
+++ b/vimrc
@@ -408,15 +408,16 @@ function Textobj_arg(inner, count)
let pos = getpos('.')
let curchar = getline(pos[1])[pos[2] - 1]
if curchar == ','
- exe "normal! \<BS>"
- let pos = getpos('.')
- let curchar = getline(pos[1])[pos[2] - 1]
- endif
- while curchar =~ '\s'
+ if getline(pos[1])[pos[2] - 2] =~ '\s'
+ normal! gE
+ else
+ exe "normal! \<BS>"
+ endif
+ return Textobj_arg(a:inner, a:count)
+ elseif curchar =~ '\s'
normal! W
- let pos = getpos('.')
- let curchar = getline(pos[1])[pos[2] - 1]
- endwhile
+ return Textobj_arg(a:inner, a:count)
+ endif
let line = strpart(getline(pos[1]), 0, pos[2])
let lines = getline(1, pos[1] - 1) + [line]