aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vimrc11
1 files changed, 11 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index a42e6e6..092c92c 100644
--- a/vimrc
+++ b/vimrc
@@ -406,6 +406,17 @@ call Textobj('f', 'Textobj_fold')
" , for function arguments {{{
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'
+ normal! W
+ let pos = getpos('.')
+ let curchar = getline(pos[1])[pos[2] - 1]
+ endwhile
let line = strpart(getline(pos[1]), 0, pos[2])
let lines = getline(1, pos[1] - 1) + [line]