Skip to content

Commit 33eb9fe

Browse files
committed
Optimized jsArrowFuncArgs selector
Shaved off some average time by removing the groups, which weren't really needed to begin with
1 parent f7d2207 commit 33eb9fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

syntax/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))
214214
syntax match jsFuncArgRestDots contained /\.\.\./
215215

216216
" Matches a single keyword argument with no parens
217-
syntax match jsArrowFuncArgs /\(\k\)\+\s*\(=>\)\@=/ skipwhite contains=jsFuncArgs nextgroup=jsArrowFunction extend
217+
syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArgs nextgroup=jsArrowFunction extend
218218
" Matches a series of arguments surrounded in parens
219219
syntax match jsArrowFuncArgs /([^()]*)\s*\(=>\)\@=/ skipempty skipwhite contains=jsFuncArgs nextgroup=jsArrowFunction extend
220220

0 commit comments

Comments
 (0)