Skip to content

Commit

Permalink
Add the update-preview command
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhantk232 authored and amitu committed Sep 18, 2024
1 parent a1396dc commit b6eef92
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions components/editor/command-k/command-editor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function update(vu) {
ftd.set_value("ui.fifthtry.com/components/editor/vars#command-k-help", "delete-file");
} else if (doc.indexOf("clear-opfs") === 0) {
ftd.set_value("ui.fifthtry.com/components/editor/vars#command-k-help", "clear-opfs");
} else if (doc.indexOf("update-preview") === 0) {
ftd.set_value("ui.fifthtry.com/components/editor/vars#command-k-help", "update-preview");
} else {
ftd.set_value("ui.fifthtry.com/components/editor/vars#command-k-help", "available-commands");
}
Expand Down
8 changes: 7 additions & 1 deletion components/editor/command-k/index.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ border-color: #f5f5f5
-- show-clear-opfs-help: true
if: { vars.command-k-help == "clear-opfs" }

-- show-update-preview-help: true
if: { vars.command-k-help == "update-preview" }

-- ftd.text: $vars.command-k-error
if: { vars.command-k-error != NULL }
padding-left.px: 5
Expand Down Expand Up @@ -127,6 +130,9 @@ $on-click$: $vars.open-command-k-with-current-file(cmd=delete-file)
-- ftd.text: `push-file` (save file to server)
$on-click$: $vars.open-command-k-with-current-file(cmd=push-file)

-- ftd.text: `update-preview` (Update the preview panel)
$on-click$: $vars.open-command-k-with-current-file(cmd=update-preview)

-- end: ftd.column

-- end: show-available-commands
Expand Down Expand Up @@ -305,7 +311,7 @@ show-question: $show-update-preview-help.show-question
-- ftd.text:

You can update the preview by using this command. When you type we don't
auto update the preview due to performance reason. You can use this command
auto update the preview due to performance reasons. You can use this command
to update the preview.

-- ftd.code:
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 b6eef92

Please sign in to comment.