Added once() method

This commit is contained in:
2023-12-18 22:28:48 +02:00
parent f46565f5c2
commit 331ddab544
4 changed files with 24 additions and 5 deletions

View File

@ -105,6 +105,7 @@ export const registerOnKeyDown = (app: Editor) => {
if (event.key === "Enter" && event.shiftKey && event.ctrlKey) {
event.preventDefault();
app.currentFile().candidate = app.view.state.doc.toString();
app.api.onceEvaluator = true;
tryEvaluate(app, app.currentFile());
app.flashBackground("#404040", 200);
}
@ -114,6 +115,7 @@ export const registerOnKeyDown = (app: Editor) => {
event.preventDefault();
app.api.clearPatternCache();
app.currentFile().candidate = app.view.state.doc.toString();
app.api.onceEvaluator = true;
tryEvaluate(app, app.currentFile());
app.flashBackground("#404040", 200);
}