refac: suggestion prompts

This commit is contained in:
Timothy Jaeryang Baek
2025-07-04 23:40:31 +04:00
parent db0d2ae6d4
commit 198b89faa5
7 changed files with 32 additions and 64 deletions
@@ -207,6 +207,14 @@
selectNextTemplate(editor.view.state, editor.view.dispatch);
};
export const focus = () => {
if (editor) {
editor.view.focus();
// Scroll to the top of the editor
editor.view.dispatch(editor.view.state.tr.scrollIntoView());
}
};
// Function to find the next template in the document
function findNextTemplate(doc, from = 0) {
const patterns = [{ start: '{{', end: '}}' }];