@@ -44,7 +44,7 @@ let s:syng_strcom = '\%(string\|regex\|special\|doc\|comment\|template\)\c'
44
44
let s: syng_comment = ' \%(comment\|doc\)\c'
45
45
46
46
" Expression used to check whether we should skip a match with searchpair().
47
- let s: skip_expr = " line('.') < (prevnonblank(v:lnum) - 2000) ? dummy : s:IsSyn(line('.'),col('.'),0 )"
47
+ let s: skip_expr = " line('.') < (prevnonblank(v:lnum) - 2000) ? dummy : s:IsSyn(line('.'),col('.'),'' )"
48
48
49
49
func s: lookForParens (start ,end ,flags,time)
50
50
try
@@ -82,14 +82,14 @@ endfunction
82
82
83
83
" Check if the character at lnum:col is inside a string, comment, or is ascii.
84
84
function s: IsSyn (lnum, col , reg )
85
- return synIDattr (synID (a: lnum , a: col , 1 ), ' name' ) = ~? (a: reg ? a: reg : s: syng_strcom )
85
+ return synIDattr (synID (a: lnum , a: col , 1 ), ' name' ) = ~? (a: reg != ' ' ? a: reg : s: syng_strcom )
86
86
endfunction
87
87
88
88
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
89
89
function s: PrevNonBlankNonString (lnum)
90
90
let lnum = prevnonblank (a: lnum )
91
91
while lnum > 0
92
- if ! s: IsSyn (lnum, matchend (getline (lnum), ' ^\s*[^'' "]' ),0 )
92
+ if ! s: IsSyn (lnum, matchend (getline (lnum), ' ^\s*[^'' "]' ),' ' )
93
93
break
94
94
endif
95
95
let lnum = prevnonblank (lnum - 1 )
@@ -106,7 +106,7 @@ function s:LineHasOpeningBrackets(lnum)
106
106
let pos = match (line , ' [][(){}]' , 0 )
107
107
let last = 0
108
108
while pos != -1
109
- if ! s: IsSyn (a: lnum , pos + 1 , 0 )
109
+ if ! s: IsSyn (a: lnum , pos + 1 , ' ' )
110
110
let idx = stridx (' (){}[]' , line [pos])
111
111
if idx % 2 == 0
112
112
let open_{idx} = open_{idx} + 1
0 commit comments