From b6189a4feda697855dde5266d0f52ecc1cb326e7 Mon Sep 17 00:00:00 2001 From: doy Date: Tue, 23 Dec 2008 01:21:56 -0500 Subject: allow the Textobj function to take extra arguments to pass on to the callback --- vim/plugin/textobj.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/plugin/textobj.vim b/vim/plugin/textobj.vim index e60abd8..3578a72 100644 --- a/vim/plugin/textobj.vim +++ b/vim/plugin/textobj.vim @@ -1,12 +1,12 @@ " Text object creation {{{ " XXX: use virtualedit here, it should greatly simplify things let s:text_object_number = 0 -function Textobj(char, callback) +function Textobj(char, callback, ...) let s:text_object_number += 1 function s:textobj_{s:text_object_number}(inner, operator, count, callback) try let pos = getpos('.') - sandbox let [startline, startcol, endline, endcol] = function(a:callback)(a:inner, a:count) + sandbox let [startline, startcol, endline, endcol] = call(a:callback, [a:inner, a:count] + a:000) catch /no-match/ return finally -- cgit v1.2.3