aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-12-23 02:18:16 -0500
committerdoy <doy@tozt.net>2008-12-23 02:18:16 -0500
commit4bcc3d6fd24c550de383db17797189d16ea1a3c1 (patch)
treeb0a82f5938e3e34f54a28339337b25069cad7c41
parent30c15e82111d2297bd6b14ed5c8481d030dc52c7 (diff)
downloadvim-textobj-4bcc3d6fd24c550de383db17797189d16ea1a3c1.tar.gz
vim-textobj-4bcc3d6fd24c550de383db17797189d16ea1a3c1.zip
need to make the inner textobj generator function take varargs too
-rw-r--r--vim/plugin/textobj.vim10
1 files changed, 5 insertions, 5 deletions
diff --git a/vim/plugin/textobj.vim b/vim/plugin/textobj.vim
index 1a3769f..a9f8624 100644
--- a/vim/plugin/textobj.vim
+++ b/vim/plugin/textobj.vim
@@ -3,7 +3,7 @@
let s:text_object_number = 0
function Textobj(char, callback, ...)
let s:text_object_number += 1
- function s:textobj_{s:text_object_number}(inner, operator, count, callback)
+ function s:textobj_{s:text_object_number}(inner, operator, count, callback, ...)
try
let pos = getpos('.')
sandbox let [startline, startcol, endline, endcol] = call(a:callback, [a:inner, a:count] + a:000)
@@ -50,10 +50,10 @@ function Textobj(char, callback, ...)
let &virtualedit = virtualedit
endfunction
- exe 'onoremap <silent>a'.a:char.' <Esc>:call <SID>textobj_'.s:text_object_number.'(0, v:operator, v:prevcount, "'.a:callback.'")<CR>'
- exe 'onoremap <silent>i'.a:char.' <Esc>:call <SID>textobj_'.s:text_object_number.'(1, v:operator, v:prevcount, "'.a:callback.'")<CR>'
- exe 'xnoremap <silent>a'.a:char.' <Esc>:call <SID>textobj_'.s:text_object_number.'(0, "v", v:prevcount, "'.a:callback.'")<CR>'
- exe 'xnoremap <silent>i'.a:char.' <Esc>:call <SID>textobj_'.s:text_object_number.'(1, "v", v:prevcount, "'.a:callback.'")<CR>'
+ exe 'onoremap <silent>a'.a:char.' <Esc>:call call("<SID>textobj_'.s:text_object_number.'", [0, v:operator, v:prevcount, "'.a:callback.'"] + '.string(a:000).')<CR>'
+ exe 'onoremap <silent>i'.a:char.' <Esc>:call call("<SID>textobj_'.s:text_object_number.'", [1, v:operator, v:prevcount, "'.a:callback.'"] + '.string(a:000).')<CR>'
+ exe 'xnoremap <silent>a'.a:char.' <Esc>:call call("<SID>textobj_'.s:text_object_number.'", [0, "v", v:prevcount, "'.a:callback.'"] + '.string(a:000).')<CR>'
+ exe 'xnoremap <silent>i'.a:char.' <Esc>:call call("<SID>textobj_'.s:text_object_number.'", [1, "v", v:prevcount, "'.a:callback.'"] + '.string(a:000).')<CR>'
endfunction
" }}}
" Text object definitions {{{