mirror of
https://github.com/keith/swift.vim.git
synced 2025-12-22 12:14:13 +01:00
Move comment pattern, update division operator
This fixes an issue where the beginning /* in a C-style block comment was interpreted as an operator. I read somewhere in syntax.txt (I think) that the order rules appear in the syntax definition file affects the interpretation. This is one of those times. The comment block needs to be after the operator definitions.
This commit is contained in:
@@ -15,13 +15,6 @@ syntax match swiftShebang "\v#!.*$"
|
||||
syntax keyword swiftTodos contained TODO XXX FIXME NOTE
|
||||
syntax keyword swiftMarker contained MARK
|
||||
|
||||
" Comment patterns
|
||||
syntax match swiftComment "\v\/\/.*$"
|
||||
\ contains=swiftTodos,swiftMarker,@Spell oneline
|
||||
syntax region swiftComment start="\v^\s*\/\*" end="\v\*\/"
|
||||
\ contains=swiftTodos,swiftMarker,swiftComment,@Spell fold
|
||||
|
||||
|
||||
" Literals
|
||||
" Strings
|
||||
syntax region swiftString start=/"/ skip=/\\"/ end=/"/ contains=swiftInterpolatedWrapper
|
||||
@@ -53,7 +46,7 @@ syntax match swiftOperator "\v-"
|
||||
syntax match swiftOperator "\v\+"
|
||||
syntax match swiftOperator "\v\="
|
||||
syntax match swiftOperator "\v\|"
|
||||
syntax match swiftOperator "\v[^/"]\/[^/"]"
|
||||
syntax match swiftOperator "\v\/"
|
||||
syntax match swiftOperator "\v\."
|
||||
syntax match swiftOperator "\v\<"
|
||||
syntax match swiftOperator "\v\>"
|
||||
@@ -156,6 +149,13 @@ syntax keyword swiftPreprocessor
|
||||
\ #endif
|
||||
|
||||
|
||||
" Comment patterns
|
||||
syntax match swiftComment "\v\/\/.*$"
|
||||
\ contains=swiftTodos,swiftMarker,@Spell oneline
|
||||
syntax region swiftComment start="/\*" end="\*/"
|
||||
\ contains=swiftTodos,swiftMarker,swiftComment,@Spell fold
|
||||
|
||||
|
||||
" Set highlights
|
||||
highlight default link swiftTodos Todo
|
||||
highlight default link swiftShebang Comment
|
||||
|
||||
Reference in New Issue
Block a user