Skip to content

Commit

Permalink
include more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rgbkrk committed Jan 14, 2024
1 parent dcbe354 commit 4deb53a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>({
create: () => "",
update: (cellId) => {
Expand All @@ -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,
Expand Down

0 comments on commit 4deb53a

Please sign in to comment.