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
@@ -21,7 +21,7 @@ function! commentary#go(type,...) abort
21
21
let [lnum1, lnum2] = [line (" '[" ), line (" ']" )]
22
22
endif
23
23
24
- let [l , r ] = s: surroundings ()
24
+ let [l , r ] = commentary# surroundings ()
25
25
let uncomment = 2
26
26
for lnum in range (lnum1,lnum2)
27
27
let line = matchstr (getline (lnum),' \S.*\s\@<!' )
@@ -55,7 +55,7 @@ function! commentary#go(type,...) abort
55
55
endfunction
56
56
57
57
function ! commentary#textobject (inner) abort
58
- let [l , r ] = s: surroundings ()
58
+ let [l , r ] = commentary# surroundings ()
59
59
let lnums = [line (' .' )+ 1 , line (' .' )-2 ]
60
60
for [index , dir , bound, line ] in [[0 , -1 , 1 , ' ' ], [1 , 1 , line (' $' ), ' ' ]]
61
61
while lnums[index ] != bound && line == # ' ' || ! (stridx (line ,l ) || line [strlen (line )- strlen (r ) : -1 ] != r )
0 commit comments