Update Combinatory.newt, fix parse error

This commit is contained in:
2025-11-15 14:18:12 -08:00
parent acb240db3f
commit 75716091af
5 changed files with 39 additions and 76 deletions

View File

@@ -30,10 +30,14 @@ export function activate(context: vscode.ExtensionContext) {
const changes = event.contentChanges;
if (changes.length === 0) return;
// TODO - agda input mode does the replacement as soon as possible
// but if the sequence is a prefix, it will change for subsequent characters
// The latter would require keeping state, but if we don't allow sequences to prefix
// each other, we could activate quicker.
const lastChange = changes[changes.length - 1];
const text = lastChange.text;
// Check if the last change is a potential shortcut trigger
if (!text || !( " ')\\".includes(text) || text.startsWith('\n'))) return;
if (!text || !( " ')\\_".includes(text) || text.startsWith('\n'))) return;
const document = editor.document;
const position = lastChange.range.end;