aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-11-11 18:56:57 +0100
committerTeddy Wing2018-11-11 18:58:41 +0100
commitd9d11b162268b384f2c3229f28b2af2f70687753 (patch)
tree1e695f79e35ea71a041858ed7f430351a9e0167e
parentdd49b86d20e4cacfb719e6c07ff6e11e375061f6 (diff)
downloadvim-dome-key-d9d11b162268b384f2c3229f28b2af2f70687753.tar.bz2
syntax/dome_key.vim: Escape special keys with `\`
Make `domeKeyDefinitionTrigger` separate from `domeKeySpecialKey`, otherwise the escape handling in the `start` of `domeKeySpecialKey` causes `domeKeyDefinitionTrigger` to stop highlighting.
-rw-r--r--syntax/dome_key.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/syntax/dome_key.vim b/syntax/dome_key.vim
index a87a94d..fcbffa9 100644
--- a/syntax/dome_key.vim
+++ b/syntax/dome_key.vim
@@ -5,9 +5,10 @@ endif
syntax region domeKeyComment display start="#" end="$" contains=@Spell
" Special keys
-syntax region domeKeySpecialKey display matchgroup=domeKeySpecialKeyGroup start="<" end=">" contained contains=domeKeySpecialKeyKeyword
+syntax region domeKeySpecialKey display matchgroup=domeKeySpecialKeyGroup start="[^\\]<" end=">" contained contains=domeKeySpecialKeyKeyword
+
+syntax match domeKeyDefinitionTrigger "\c\(<\(Up\|Play\|Down\)>\)\+" contained
-syntax match domeKeyDefinitionTrigger "\c\(<\(Up\|Play\|Down\)>\)\+" contained contains=domeKeySpecialKey
" Map definitions
syntax match domeKeyMapDefinitionStart "^\s*map" contains=domeKeyType nextgroup=domeKeyMapDefinitionTrigger skipwhite
@@ -54,6 +55,7 @@ highlight default link domeKeyComment Comment
highlight default link domeKeyType Statement
highlight default link domeKeySpecialKeyGroup Special
highlight default link domeKeySpecialKeyKeyword domeKeySpecialKeyGroup
+highlight default link domeKeyDefinitionTrigger domeKeySpecialKeyGroup
" TODO:
" - Escaping only in actions