1
- function ! s: surroundings () abort
1
+ function ! commentary# surroundings () abort
2
2
return split (get (b: , ' commentary_format' , substitute (substitute (
3
3
\ &commentstring , ' \S\zs%s' ,' %s' ,' ' ) ,' %s\ze\S' , ' %s ' , ' ' )), ' %s' , 1 )
4
4
endfunction
@@ -24,7 +24,7 @@ function! commentary#go(...) abort
24
24
let [lnum1, lnum2] = [line (" '[" ), line (" ']" )]
25
25
endif
26
26
27
- let [l , r ] = s: surroundings ()
27
+ let [l , r ] = commentary# surroundings ()
28
28
let uncomment = 2
29
29
for lnum in range (lnum1,lnum2)
30
30
let line = matchstr (getline (lnum),' \S.*\s\@<!' )
@@ -59,7 +59,7 @@ function! commentary#go(...) abort
59
59
endfunction
60
60
61
61
function ! commentary#textobject (inner) abort
62
- let [l , r ] = s: surroundings ()
62
+ let [l , r ] = commentary# surroundings ()
63
63
let lnums = [line (' .' )+ 1 , line (' .' )-2 ]
64
64
for [index , dir , bound, line ] in [[0 , -1 , 1 , ' ' ], [1 , 1 , line (' $' ), ' ' ]]
65
65
while lnums[index ] != bound && line == # ' ' || ! (stridx (line ,l ) || line [strlen (line )- strlen (r ) : -1 ] != r )
0 commit comments