Skip to content

Commit

Permalink
command enter to update preview, and shift to avoid enter
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Sep 29, 2024
1 parent 36db96d commit 0c95618
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions components/editor/command-k/command-editor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,15 @@ document.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
ftd.set_value("ui.fifthtry.com/components/editor/vars#command-k", false);
ide_clear_context_menu();
} else if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
ide_open_command_k("update-preview");
// if shift is pressed, execute the command
if (e.shiftKey) run_parser();
e.preventDefault();
} else if (e.key === "s" && (e.metaKey || e.ctrlKey)) {
ide_open_command_k("push-file " + ftd.get_value("ui.fifthtry.com/components/editor/vars#current-file"));
// if shift is pressed, execute the command
if (e.shiftKey) run_parser();
e.preventDefault();
} else if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion components/editor/editor-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/editor/editor-bundle.js.map

Large diffs are not rendered by default.

0 comments on commit 0c95618

Please sign in to comment.