parkerziegler/reviz

feat: Execute program on ⌘ / ^ S and ⌘ / ^ Enter.

Closed this issue · 0 comments

To speed up program execution in the Visualize tab, we'll want to add keyboard event handlers for executing the program. In particular, we'll want to add ⌘ / ^ S to match a traditional "save" reflex and ⌘ / ^ Enter to match behavior on Observable. To do this, we'll want to wire up event handlers to the CodeMirror editor using the static EditorView.domEventHandlers API.

  • Add event listener for ⌘ / ^ S and ⌘ / ^ Enter using EditorView.domEventHandlers API.
  • Display the proper altering key (either ⌘ or ^) depending on the OS detected in navigator.userAgent.