Skip to content

Commit

Permalink
fix syntax highlighting not working properly for tokens at line begin…
Browse files Browse the repository at this point in the history
…ning

fixes #10
  • Loading branch information
rszyma committed Feb 3, 2024
1 parent 31b9b9d commit c582923
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions syntaxes/kanata.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
{
"_description": "defcfg options",
"match": "(?:\\s|[()])(sequence-timeout|sequence-input-mode|linux-dev|linux-dev-names-include|linux-dev-names-exclude|linux-unicode-u-code|linux-unicode-termination|linux-x11-repeat-delay-rate|windows-altgr|windows-interception-mouse-hwid|macos-dev-names-include|process-unmapped-keys|block-unmapped-keys|danger-enable-cmd|sequence-backtrack-modcancel|log-layer-changes|delegate-to-first-layer|linux-continue-if-no-devs-found|movemouse-inherit-accel-state|movemouse-smooth-diagonals|dynamic-macro-max-presses|concurrent-tap-hold)(?=\\s|[()])",
"match": "(?:^|\\s|[()])(sequence-timeout|sequence-input-mode|linux-dev|linux-dev-names-include|linux-dev-names-exclude|linux-unicode-u-code|linux-unicode-termination|linux-x11-repeat-delay-rate|windows-altgr|windows-interception-mouse-hwid|macos-dev-names-include|process-unmapped-keys|block-unmapped-keys|danger-enable-cmd|sequence-backtrack-modcancel|log-layer-changes|delegate-to-first-layer|linux-continue-if-no-devs-found|movemouse-inherit-accel-state|movemouse-smooth-diagonals|dynamic-macro-max-presses|concurrent-tap-hold)(?=\\s|[()])",
"captures": {
"1": {
"name": "constant.language.kanata"
Expand All @@ -38,7 +38,7 @@
},
{
"_description": "defcfg constants",
"match": "(?:\\s|[()])(true|yes|false|no)(?=\\s|[()])",
"match": "(?:^|\\s|[()])(true|yes|false|no)(?=\\s|[()])",
"captures": {
"1": {
"name": "constant.other.boolean.kanata"
Expand All @@ -47,7 +47,7 @@
},
{
"_description": "atom actions",
"match": "(?:\\s|[()])(XX|lrld|lrld-next|lrnx|lrld-prev|lrpv|sldr|mlft|mouseleft|mrgt|mouseright|mmid|mousemid|mfwd|mouseforward|mbck|mousebackward|mltp|mousetapleft|mrtp|mousetapright|mmtp|mousetapmid|mftp|mousetapforward|mbtp|mousetapbackward|rpt|rpt-key|rpt-any|repeat|dynamic-macro-record-stop|mwu|mwd|mwl|mwr|mousewheelup|mousewheeldown|mousewheelleft|mousewheelright)(?=\\s|[()])",
"match": "(?:^|\\s|[()])(XX|lrld|lrld-next|lrnx|lrld-prev|lrpv|sldr|mlft|mouseleft|mrgt|mouseright|mmid|mousemid|mfwd|mouseforward|mbck|mousebackward|mltp|mousetapleft|mrtp|mousetapright|mmtp|mousetapmid|mftp|mousetapforward|mbtp|mousetapbackward|rpt|rpt-key|rpt-any|repeat|dynamic-macro-record-stop|mwu|mwd|mwl|mwr|mousewheelup|mousewheeldown|mousewheelleft|mousewheelright)(?=\\s|[()])",
"captures": {
"1": {
"name": "constant.language.kanata"
Expand All @@ -56,7 +56,7 @@
},
{
"_description": "list actions",
"match": "(?:\\s|[()])(layer-switch|layer-toggle|layer-while-held|tap-hold|tap-hold-press|tap-hold-release|tap-hold-press-timeout|tap-hold-release-timeout|tap-hold-release-keys|tap-hold-except-keys|multi|macro|macro-repeat|macro-release-cancel|macro-repeat-release-cancel|unicode|one-shot|one-shot-press|one-shot-release|one-shot-press-pcancel|one-shot-release-pcancel|tap-dance|tap-dance-eager|chord|release-key|release-layer|on-press-fakekey|on-release-fakekey|on-press-fakekey-delay|on-release-fakekey-delay|on-idle-fakekey|mwheel-up|mwheel-down|mwheel-left|mwheel-right|movemouse-up|movemouse-down|movemouse-left|movemouse-right|movemouse-accel-up|movemouse-accel-down|movemouse-accel-left|movemouse-accel-right|movemouse-speed|setmouse|dynamic-macro-record|dynamic-macro-play|arbitrary-code|cmd|cmd-output-keys|fork|caps-word|caps-word-custom|dynamic-macro-record-stop-truncate|switch|sequence|unmod|unshift|concat|lrld-num)(?=\\s|[()])",
"match": "(?:^|\\s|[()])(layer-switch|layer-toggle|layer-while-held|tap-hold|tap-hold-press|tap-hold-release|tap-hold-press-timeout|tap-hold-release-timeout|tap-hold-release-keys|tap-hold-except-keys|multi|macro|macro-repeat|macro-release-cancel|macro-repeat-release-cancel|unicode|one-shot|one-shot-press|one-shot-release|one-shot-press-pcancel|one-shot-release-pcancel|tap-dance|tap-dance-eager|chord|release-key|release-layer|on-press-fakekey|on-release-fakekey|on-press-fakekey-delay|on-release-fakekey-delay|on-idle-fakekey|mwheel-up|mwheel-down|mwheel-left|mwheel-right|movemouse-up|movemouse-down|movemouse-left|movemouse-right|movemouse-accel-up|movemouse-accel-down|movemouse-accel-left|movemouse-accel-right|movemouse-speed|setmouse|dynamic-macro-record|dynamic-macro-play|arbitrary-code|cmd|cmd-output-keys|fork|caps-word|caps-word-custom|dynamic-macro-record-stop-truncate|switch|sequence|unmod|unshift|concat|lrld-num)(?=\\s|[()])",
"captures": {
"1": {
"name": "entity.name.function.kanata"
Expand All @@ -65,7 +65,7 @@
},
{
"_description": "fake key actions",
"match": "(?:\\s|[()])(press|release|tap|toggle)(?=\\s|[()])",
"match": "(?:^|\\s|[()])(press|release|tap|toggle)(?=\\s|[()])",
"captures": {
"1": {
"name": "constant.language.kanata"
Expand All @@ -75,7 +75,7 @@
{
"_description": "switch atom actions/keywords",
"_note": "also there should be a 'break' keyword, but it's also a key",
"match": "(?:\\s|[()])(fallthrough)(?=\\s|[()])",
"match": "(?:^|\\s|[()])(fallthrough)(?=\\s|[()])",
"captures": {
"1": {
"name": "constant.language.kanata"
Expand All @@ -84,7 +84,7 @@
},
{
"_description": "switch list actions/keywords",
"match": "(?:\\s|[()])(or|and|key-history)(?=\\s|[()])",
"match": "(?:^|\\s|[()])(or|and|key-history)(?=\\s|[()])",
"captures": {
"1": {
"name": "entity.name.function.kanata"
Expand All @@ -93,7 +93,7 @@
},
{
"_description": "keys",
"match": "(?:\\s|[()])(\\\\|\\{|\\}|'|\\/|\\.|,|-|=|\\[|\\]|;|grv|grave|1|2|3|4|5|6|7|8|9|0|min|eql|bspc|bks|tab|q|w|e|r|t|y|u|i|o|p|lbrc|rbrc|bksl|yen|¥|caps|a|s|d|f|g|h|j|k|l|scln|apo|apos|ret|return|ent|enter|lshift|lshft|lsft|shft|sft|z|x|c|v|b|n|m|comm|kp=|clr|kp0|kp1|kp2|kp3|kp4|kp5|kp6|kp7|kp8|kp9|kprt|kp\\/|kp\\+|kp\\*|kp-|kp\\.|ssrq|sys|102d|lsgt|nubs|nonusbslash|scrlck|slck|pause|break|brk|wkup|esc|rshift|rshft|rsft|lctrl|lctl|ctl|lalt|alt|spc|ralt|comp|cmps|cmp|menu|apps|lmeta|lmet|met|rmeta|rmet|rctrl|rctl|del|ins|bck|fwd|pgup|pgdn|up|down|lft|left|rght|right|home|end|nlck|nlk|mute|volu|voldwn|vold|brup|bru|brdown|brdwn|brdn|blup|bldn|next|pp|prev|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|kana|katakana|katakanahiragana|hiragana|cnv|conv|henk|hnk|henkan|ncnv|mhnk|muhenkan|ro|prtsc|prnt|mlft|mouseleft|mrgt|mouseright|mmid|mousemid|mfwd|mouseforward|mbck|mousebackward|hmpg|homepage|mdia|media|mail|email|calc|plyr|player|powr|power|zzz|sleep)(?=\\s|[()])",
"match": "(?:^|\\s|[()])(\\\\|\\{|\\}|'|\\/|\\.|,|-|=|\\[|\\]|;|grv|grave|1|2|3|4|5|6|7|8|9|0|min|eql|bspc|bks|tab|q|w|e|r|t|y|u|i|o|p|lbrc|rbrc|bksl|yen|¥|caps|a|s|d|f|g|h|j|k|l|scln|apo|apos|ret|return|ent|enter|lshift|lshft|lsft|shft|sft|z|x|c|v|b|n|m|comm|kp=|clr|kp0|kp1|kp2|kp3|kp4|kp5|kp6|kp7|kp8|kp9|kprt|kp\\/|kp\\+|kp\\*|kp-|kp\\.|ssrq|sys|102d|lsgt|nubs|nonusbslash|scrlck|slck|pause|break|brk|wkup|esc|rshift|rshft|rsft|lctrl|lctl|ctl|lalt|alt|spc|ralt|comp|cmps|cmp|menu|apps|lmeta|lmet|met|rmeta|rmet|rctrl|rctl|del|ins|bck|fwd|pgup|pgdn|up|down|lft|left|rght|right|home|end|nlck|nlk|mute|volu|voldwn|vold|brup|bru|brdown|brdwn|brdn|blup|bldn|next|pp|prev|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|kana|katakana|katakanahiragana|hiragana|cnv|conv|henk|hnk|henkan|ncnv|mhnk|muhenkan|ro|prtsc|prnt|mlft|mouseleft|mrgt|mouseright|mmid|mousemid|mfwd|mouseforward|mbck|mousebackward|hmpg|homepage|mdia|media|mail|email|calc|plyr|player|powr|power|zzz|sleep)(?=\\s|[()])",
"captures": {
"1": {
"name": "string.kanata"
Expand All @@ -102,7 +102,7 @@
},
{
"_description": "aliases starting with @, and variables starting with $",
"match": "(?:\\s|[#()\\]\\[{}-])((?:@|\\$).+?)(?=\\s|[()])",
"match": "(?:^|\\s|[#()\\]\\[{}-])((?:@|\\$).+?)(?=\\s|[()])",
"captures": {
"1": {
"name": "variable.parameter.kanata"
Expand Down

0 comments on commit c582923

Please sign in to comment.