From 4deb53ab09b491905cbf6ef3e8a3e016f7286b82 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sun, 14 Jan 2024 15:13:37 -0800 Subject: [PATCH] include more comments --- src/components/Editor.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index ec6e8f4..9921757 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -32,6 +32,9 @@ const styleTheme = EditorView.baseTheme({ } }); +// TODO(Kyle): I'm not sure if this is the best way to associate a cellId with a CodeMirror instance. +// `create` takes an EditorState and returns the putative cellId. We don't know it at this +// point, so we just return an empty string. `update` is called with the cellId. const cellIdState = StateField.define({ create: () => "", update: (cellId) => { @@ -55,6 +58,8 @@ export const executeAndGoDownKeybinding = { run: (view: EditorView) => { const cellId = view.state.field(cellIdState); invoke("execute_cell", { cellId }); + + // TODO(Kyle): Dispatch action to focus next cell or create a new one return true; }, preventDefault: true,