Skip to content

Commit

Permalink
feat(ui): add shortcut to Output Debugger (#4612)
Browse files Browse the repository at this point in the history
Use Ctrl+Enter to run the debug expression.
  • Loading branch information
yuri1969 authored and fhussonnois committed Aug 14, 2024
1 parent f9186b2 commit 654d621
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions ui/src/components/executions/outputs/Wrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
:input="true"
:navbar="false"
:model-value="computedDebugValue"
@confirm="onDebugExpression($event)"
class="w-100"
/>

Expand Down
15 changes: 14 additions & 1 deletion ui/src/components/inputs/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
components: {
MonacoEditor,
},
emits: ["save", "execute", "focusout", "tab", "update:modelValue", "cursor"],
emits: ["save", "execute", "focusout", "tab", "update:modelValue", "cursor", "confirm"],
editor: undefined,
data() {
return {
Expand Down Expand Up @@ -262,6 +262,19 @@
}
});
this.editor.addAction({
id: "confirm",
label: "Confirm",
keybindings: [
KeyMod.CtrlCmd | KeyCode.Enter,
],
contextMenuGroupId: "navigation",
contextMenuOrder: 1.5,
run: (ed) => {
this.$emit("confirm", ed.getValue())
}
});
// TabFocus is global to all editor so revert the behavior on non inputs
this.editor.onDidFocusEditorText?.(() => {
TabFocus.setTabFocusMode(this.input);
Expand Down

0 comments on commit 654d621

Please sign in to comment.