perf: use treesitter to detect math/markup

This commit is contained in:
arne314
2024-12-08 18:39:58 +01:00
parent 999fd0dfef
commit 5529a29327
4 changed files with 52 additions and 9 deletions

View File

@@ -63,6 +63,7 @@ return {
snip('rrn', 'RR^n ', {}, math),
snip('cc', 'cases(\n\t<>\n)\\', { i(1, '1') }, math),
snip('pi', 'pi ', {}, math),
snip('in', 'in ', {}, math),
snip('(.*)iv', '<>^(-1)', { cap(1) }, math),
snip('(.*)sr', '<>^(2)', { cap(1) }, math),
snip('(.*)rd', '<>^(<>)', { cap(1), i(1, 'n') }, math),

View File

@@ -14,7 +14,7 @@ local operations = { -- boolean denotes whether an additional layer of () bracke
{ 'vi', '1/(', ')', true },
{ 'bb', '(', ')', false },
{ 'sq', '[', ']', true },
{ 'abs', '|', '|', false },
{ 'abs', 'abs(', ')', false },
{ 'ul', 'underline(', ')', false },
{ 'ol', 'overline(', ')', false },
{ 'ub', 'underbrace(', ')', false },