Skip to content

add: ⟨...⟩ as possible brackets - #51

Open
Quoteme wants to merge 1 commit into
uben0:masterfrom
Quoteme:add-utf8-delimiters
Open

Quoteme wants to merge 1 commit into
uben0:masterfrom
Quoteme:add-utf8-delimiters

Conversation

@Quoteme

@Quoteme Quoteme commented Jan 11, 2026 •

Copy link
Copy Markdown

Hi dear treesitter/typst community,

inner products are commonly denoted using $angle.l ..., ... angle.r$ or as of recently $chevron.l ..., ... chevron.r$ in typst documents.
Another valid method it seems is to use unicode characters like $⟨..., ...⟩$ instead (imo more readable).

Especially in deeply nested equations using a plugin like HiPhish/rainbow-delimiters.nvim is a good way to not get lost. It does however depend on the underlying treesitter parser being able to identify ⟨ and ⟩ as bracket pairs, just like ( and ). Currently, this was not the case.

I made some changes so that ⟨ and ⟩ does get recognised as a bracket pair, resulting in this pull request. Could you please skim over it and possibly merge it? I am completely new to treesitter parsers, so I am not sure if my code is well written, but nonetheless I tested it and it works:

Before:
Before image
After:
After image

PS: I accidentally started development from the master branch. I will fix this when I get to it, hopefully asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant