Skip to content

Commit

Permalink
Modified syntax groups regular expressions
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
drslump committed Sep 19, 2011
1 parent 9990a76 commit 2f39355
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions indent/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ set cpo&vim
" ============

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

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

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

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

0 comments on commit 2f39355

Please sign in to comment.