Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't highlight punctuation inside binaries

  • Loading branch information...
commit 508791a7787e59c02d9af06348d61a8cd2bec14e 1 parent 03aed91
@carlosgaldino carlosgaldino authored
Showing with 27 additions and 25 deletions.
  1. +27 −25 syntax/elixir.vim
View
52 syntax/elixir.vim
@@ -40,18 +40,19 @@ syn match elixirNumber '\<\d\(_\?\d\)*\(\.[^[:space:][:digit:]]\@!\(_\?\d\)*\)\?
syn match elixirNumber '\<0[xX][0-9A-Fa-f]\+\>'
syn match elixirNumber '\<0[bB][01]\+\>'
-syn match elixirRegexEscape "\\\\\|\\[aAbBcdDefGhHnrsStvVwW]\|\\\d\{3}\|\\x[0-9a-fA-F]\{2}" contained
-syn match elixirRegexEscape "?\|\.\|*\|\[\|\]\|+\|\^\|\$\||\|(\|)\|{\|}" contained
-syn match elixirRegexQuantifier "[*?+][?+]\=" contained display
-syn match elixirRegexQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
-syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained display
+syn match elixirRegexEscape "\\\\\|\\[aAbBcdDefGhHnrsStvVwW]\|\\\d\{3}\|\\x[0-9a-fA-F]\{2}" contained
+syn match elixirRegexEscapePunctuation "?\|\.\|*\|\[\|\]\|+\|\^\|\$\||\|(\|)\|{\|}" contained
+syn match elixirRegexQuantifier "[*?+][?+]\=" contained display
+syn match elixirRegexQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
+syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained display
syn region elixirRegex matchgroup=elixirDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier
+syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
syn region elixirString matchgroup=elixirDelimiter start="'" end="'"
-syn region elixirString matchgroup=elixirDelimiter start='"' end='"' contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
+syn region elixirString matchgroup=elixirDelimiter start='"' end='"' contains=@elixirStringContained
syn region elixirInterpolation matchgroup=elixirDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment
syn region elixirDocString start=+"""+ end=+"""+
syn region elixirDocString start=+'''+ end=+'''+
@@ -59,22 +60,23 @@ syn region elixirDocString start=+'''+ end=+'''+
syn match elixirSymbolInterpolated ':\("\)\@=' contains=elixirString
syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)"
-hi def link elixirComment Comment
-hi def link elixirKeyword Keyword
-hi def link elixirOperator Operator
-hi def link elixirSymbol Constant
-hi def link elixirPseudoVariable Constant
-hi def link elixirName Type
-hi def link elixirBoolean Boolean
-hi def link elixirVariable Identifier
-hi def link elixirNumber Number
-hi def link elixirDocString Comment
-hi def link elixirInterpolation Delimiter
-hi def link elixirSymbolInterpolated elixirSymbol
-hi def link elixirRegex elixirString
-hi def link elixirRegexEscape elixirSpecial
-hi def link elixirRegexCharClass elixirSpecial
-hi def link elixirRegexQuantifier elixirSpecial
-hi def link elixirSpecial Special
-hi def link elixirString String
-hi def link elixirDelimiter Delimiter
+hi def link elixirComment Comment
+hi def link elixirKeyword Keyword
+hi def link elixirOperator Operator
+hi def link elixirSymbol Constant
+hi def link elixirPseudoVariable Constant
+hi def link elixirName Type
+hi def link elixirBoolean Boolean
+hi def link elixirVariable Identifier
+hi def link elixirNumber Number
+hi def link elixirDocString Comment
+hi def link elixirInterpolation Delimiter
+hi def link elixirSymbolInterpolated elixirSymbol
+hi def link elixirRegex elixirString
+hi def link elixirRegexEscape elixirSpecial
+hi def link elixirRegexEscapePunctuation elixirSpecial
+hi def link elixirRegexCharClass elixirSpecial
+hi def link elixirRegexQuantifier elixirSpecial
+hi def link elixirSpecial Special
+hi def link elixirString String
+hi def link elixirDelimiter Delimiter
Please sign in to comment.
Something went wrong with that request. Please try again.