Skip to content

Commit

Permalink
syntax: Reorganize links to highlight groups a little more
Browse files Browse the repository at this point in the history
Two things:

* regular expressions use a syntax group for the / delimiters but they
  are not linked to a highlight group. regular expression are a little
  bit like strings in that their content is treated as some special kind
  of data.

* bracket/brace/parens should not be marked as delimiters. sure, they
  contain things but what they contain is not treated as special and
  doesn't represent actual data like strings and regexps -- if there's
  data in between those then other syntax groups should already be
  highlighting those parts. switching them to Operator adds more
  diversity in the symbols and makes the code more readable.
  • Loading branch information
lelutin committed Sep 8, 2024
1 parent c19c60c commit 1ec12e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions syntax/puppet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,7 @@ syn region puppetComment start="/\*" end="\*/" contains=puppetTodo,puppet
syn keyword puppetTodo TODO NOTE FIXME XXX BUG HACK contained

hi def link puppetStringDelimiter Delimiter
hi def link puppetBracket Delimiter
hi def link puppetBrace Delimiter
hi def link puppetParen Delimiter
hi def link puppetRegexpDelimiter Delimiter
hi def link puppetRegexp puppetConstant
hi def link puppetConstant Constant
hi def link puppetNoInterpolation puppetString
Expand All @@ -501,6 +499,9 @@ hi def link puppetFloat Float
hi def link puppetInteger Number
hi def link puppetBoolean Boolean
hi def link puppetType Type
hi def link puppetBracket Operator
hi def link puppetBrace Operator
hi def link puppetParen Operator
hi def link puppetOperator Operator
hi def link puppetStructure Structure
hi def link puppetName puppetIdentifier
Expand Down

0 comments on commit 1ec12e0

Please sign in to comment.