From 4bcc3d6fd24c550de383db17797189d16ea1a3c1 Mon Sep 17 00:00:00 2001 From: doy Date: Tue, 23 Dec 2008 02:18:16 -0500 Subject: need to make the inner textobj generator function take varargs too --- vim/plugin/textobj.vim | 10 +++++----- 1 file 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 a'.a:char.' :call textobj_'.s:text_object_number.'(0, v:operator, v:prevcount, "'.a:callback.'")' - exe 'onoremap i'.a:char.' :call textobj_'.s:text_object_number.'(1, v:operator, v:prevcount, "'.a:callback.'")' - exe 'xnoremap a'.a:char.' :call textobj_'.s:text_object_number.'(0, "v", v:prevcount, "'.a:callback.'")' - exe 'xnoremap i'.a:char.' :call textobj_'.s:text_object_number.'(1, "v", v:prevcount, "'.a:callback.'")' + exe 'onoremap a'.a:char.' :call call("textobj_'.s:text_object_number.'", [0, v:operator, v:prevcount, "'.a:callback.'"] + '.string(a:000).')' + exe 'onoremap i'.a:char.' :call call("textobj_'.s:text_object_number.'", [1, v:operator, v:prevcount, "'.a:callback.'"] + '.string(a:000).')' + exe 'xnoremap a'.a:char.' :call call("textobj_'.s:text_object_number.'", [0, "v", v:prevcount, "'.a:callback.'"] + '.string(a:000).')' + exe 'xnoremap i'.a:char.' :call call("textobj_'.s:text_object_number.'", [1, "v", v:prevcount, "'.a:callback.'"] + '.string(a:000).')' endfunction " }}} " Text object definitions {{{ -- cgit v1.2.3