Skip to content

Commit

Permalink
Merge pull request #19 from helsmy/hightlight-issue-#18
Browse files Browse the repository at this point in the history
hightlight issue #18
  • Loading branch information
helsmy committed Apr 15, 2023
2 parents 2315db7 + b9b2ef5 commit 3cd2ae2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions syntaxes/ahk.YAML-tmLanguage
Expand Up @@ -146,16 +146,22 @@ repository:
name: string.unquoted.hotstring.ahk
hotkey:
name: meta.hotkey.line.ahk
begin: ^([#!^+&<>*~$]+|(?:<\^>!))?([!-/]|[:-@]|[\[-`]|[\{-~]|[a-zA-Z0-9]+)(\s&\s([!-/]|[:-@]|[\[-`]|[\{-~]|[a-zA-Z0-9]+))?(?=::)
begin: ^([#!^+&<>*~$]+|(?:<\^>!))?([!-/]|[:-@]|[\[-`]|[\{-~]|[a-zA-Z0-9]+)(\s&\s([!-/]|[:-@]|[\[-`]|[\{-~]|[a-zA-Z0-9]+))?([ \t]+(?i:UP))?(?=::)
beginCaptures:
"1":
name: storage.modifier.hotkey.ahk
"2":
patterns:
- include: "#keylist"
- include: "#single-alphanum-key"
- include: "#single-mark-key"
"4":
patterns:
- include: "#keylist"
- include: "#single-alphanum-key"
- include: "#single-mark-key"
"5":
name: storage.modifier.up.hotkey.ahk
end: "::"
endCaptures:
"0":
Expand All @@ -164,7 +170,18 @@ repository:
- include: "#comment"
keylist:
match: \b(?i:shift|lshift|rshift|alt|lalt|ralt|control|lcontrol|rcontrol|ctrl|lctrl|rctrl|lwin|rwin|appskey|lbutton|rbutton|mbutton|WheelUp|WheelDown|wheelleft|wheelright|xbutton1|xbutton2|joy1|joy2|joy3|joy4|joy5|joy6|joy7|joy8|joy9|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy30|joy31|joy32|joyx|joyy|joyz|joyr|joyu|joyv|joypov|joyname|joybuttons|joyaxes|joyinfo|space|tab|enter|escape|esc|backspace|bs|delete|del|insert|ins|pgdn|pgup|home|end|up|down|left|right|printscreen|ctrlbreak|pause|scrolllock|capslock|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadmult|numpadadd|numpadsub|numpaddiv|numpaddot|numpaddel|numpadins|numpadclear|numpadleft|numpadright|numpaddown|numpadup|numpadhome|numpadend|numpadpgdn|numpadpgup|numpadenter|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|browser_back|browser_forward|browser_refresh|browser_stop|browser_search|browser_favorites|browser_home|volume_mute|volume_down|volume_up|media_next|media_prev|media_stop|media_play_pause|launch_mail|launch_media|launch_app1|launch_app2|vk[a-f\d]{1,2}(sc[a-f\d]+)?|sc[a-f\d]+)\b
name: markup.bold.hotkey.ahk
name: markup.bold.string.hotkey.ahk
# match single key `abcd123...`
single-alphanum-key:
match: (?<![a-zA-Z0-9])[a-zA-Z0-9](?![a-zA-Z0-9])
name: markup.bold.string.hotkey.ahk
# any possible other single key eg. `$`
single-mark-key:
match: "[!-\/:-@\\[-`\\{-~]"
# Force vscode consider hotkey as `string` with `string` section.
# `string` type tokens are exempt from pairing check of `editor.matchBrackets`,
# and single hotkey liking `{` can be highlight correctly.
name: markup.bold.string.hotkey.ahk
label:
name: meta.labelline.ahk
match: ^\s*(\w+)(:)\s*(;.*)?$
Expand Down

0 comments on commit 3cd2ae2

Please sign in to comment.