Skip to content

Commit

Permalink
feat: understand "?" conditional of config-file (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
bezhermoso authored Dec 30, 2024
1 parent d648b2d commit c6bd5c3
Show file tree
Hide file tree
Showing 6 changed files with 1,809 additions and 1,714 deletions.
5 changes: 4 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ module.exports = grammar({

// `config-file` directive
config_file_directive: $ => directive_seq(alias("config-file", $.property), $.path_value),
path_value: $ => $.string,
path_value: $ => seq(
optional("?"),
$.string
),

// `keybind` directive
keybind_directive: $ => directive_seq(alias("keybind", $.property), $.keybind_value),
Expand Down
2 changes: 2 additions & 0 deletions queries/ghostty/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
; `config-file`
(config_file_directive (property) @keyword.import)
(config_file_directive (path_value) @string.special.path)
(path_value "?" @keyword.conditional
(#eq? @keyword.conditional "?"))

; `keybind`
(keybind_value) @string.special
Expand Down
21 changes: 19 additions & 2 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c6bd5c3

Please sign in to comment.