Skip to content

Commit

Permalink
feat: support number tuples e.g. window-padding-{x,y} (#21)
Browse files Browse the repository at this point in the history
* feat: support number tuples e.g. `window-padding-{x,y}`
* feat(highlighting): set `(tuple ",")` as delimiter
  • Loading branch information
bezhermoso authored Jan 11, 2025
1 parent d95f742 commit e1f2692
Show file tree
Hide file tree
Showing 7 changed files with 2,311 additions and 2,139 deletions.
8 changes: 8 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,20 @@ module.exports = grammar({
choice(
$.boolean,
$.number,
$.tuple,
$.adjustment,
$.color,
$.string,
)
),

// Used by window-padding-{x,y}. Tuples only supports numbers for now.
tuple: $ => seq(
field("left", $.number),
token.immediate(","),
field("right", $.number),
),

boolean: _ => choice("true", "false"),

number: _ => number,
Expand Down
4 changes: 4 additions & 0 deletions queries/ghostty/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
(color "#" @punctuation.delimiter.special
(#eq? @punctuation.delimiter.special "#"))

; (tuple)
(tuple "," @punctuation.delimiter.special
(#eq? @punctuation.delimiter.special ","))

; `palette`
(palette_index) @variable.member

Expand Down
32 changes: 32 additions & 0 deletions src/grammar.json

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

30 changes: 30 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 e1f2692

Please sign in to comment.