Skip to content

Commit 2f39355

Browse files
committed
Modified syntax groups regular expressions
Instead of targetting the regular expressions to very specific syntax groups (ie: javaScriptDocComment), which make the indent script not compatible with other syntaxes (ie: jsComment), more generic versions are used which should still match the same groups by using case insensitive search and shorter patterns (string, regex and comment).
1 parent 9990a76 commit 2f39355

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

indent/javascript.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ set cpo&vim
3333
" ============
3434

3535
" Regex of syntax group names that are or delimit string or are comments.
36-
let s:syng_strcom = 'javaScript\%(String\|RegexpString\|CommentTodo\|LineComment\|Comment\|DocComment\)'
36+
let s:syng_strcom = 'string\|regex\|comment\c'
3737

3838
" Regex of syntax group names that are strings.
39-
let s:syng_string = 'javaScript\%(RegexpString\)'
39+
let s:syng_string = 'regex\c'
4040

4141
" Regex of syntax group names that are strings or documentation.
42-
let s:syng_stringdoc = 'javaScriptDocComment\|javaScriptComment'
42+
let s:syng_stringdoc = 'comment\c'
4343

4444
" Expression used to check whether we should skip a match with searchpair().
4545
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"

0 commit comments

Comments
 (0)