aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-03-08 22:56:14 -0500
committerJesse Luehrs <doy@tozt.net>2018-03-08 22:56:14 -0500
commit2cc0413d129da422ac8566e54b1b86909dc08dcc (patch)
treeeccf02e4a9539559ce2ebf5783ea0e45a3fd7637
parent64a149f31450b415bf8779962255b867365f094e (diff)
downloadvim-textobj-2cc0413d129da422ac8566e54b1b86909dc08dcc.tar.gz
vim-textobj-2cc0413d129da422ac8566e54b1b86909dc08dcc.zip
don't make the functions global
-rw-r--r--plugin/textobj.vim12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugin/textobj.vim b/plugin/textobj.vim
index 12ad612..03d2b3d 100644
--- a/plugin/textobj.vim
+++ b/plugin/textobj.vim
@@ -5,7 +5,7 @@ let g:loaded_textobj = 1
" XXX: use virtualedit here, it should greatly simplify things
let s:text_object_number = 0
-function Textobj(char, callback, ...)
+function s:textobj(char, callback, ...)
let s:text_object_number += 1
function s:textobj_{s:text_object_number}(inner, operator, count, callback, ...)
try
@@ -61,7 +61,7 @@ function Textobj(char, callback, ...)
endfunction
" arbitrary paired symbols (/ for regex, etc)
-function Textobj_paired(inner, count, ...)
+function s:textobj_paired(inner, count, ...)
let char = a:1
let pos = getpos('.')
@@ -119,7 +119,7 @@ function Textobj_paired(inner, count, ...)
endfunction
" folds
-function Textobj_fold(inner, count, ...)
+function s:textobj_fold(inner, count, ...)
if foldlevel(line('.')) == 0
throw 'no-match'
endif
@@ -132,7 +132,7 @@ function Textobj_fold(inner, count, ...)
endfunction
" function arguments
-function Textobj_arg(inner, count, ...)
+function s:textobj_arg(inner, count, ...)
let pos = getpos('.')
let curchar = getline(pos[1])[pos[2] - 1]
if curchar == ','
@@ -241,9 +241,9 @@ function s:load_textobjs(defs)
if len(l:extra_args) == 0
call add(l:extra_args, l:char)
endif
- let l:args = [l:char, 'Textobj_'.l:callback]
+ let l:args = [l:char, "<SID>textobj_".l:callback]
call extend(l:args, l:extra_args)
- call call('Textobj', l:args)
+ call call("<SID>textobj", l:args)
endfor
endfunction