Skip to content

Commit

Permalink
feat:add code-editor right-click menu action
Browse files Browse the repository at this point in the history
  • Loading branch information
qing-wq committed Feb 21, 2024
1 parent 158df40 commit a78453e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spx-gui/src/components/code-editor/CodeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ onMounted(() => {
...editorOptions,
...prop.editorOptions
})
// register format action
editor.addAction({
id: 'format',
label: 'Format Code',
keybindings: [
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyL,
],
contextMenuGroupId: "navigation",
run: format
})
// register change event
editor.onDidChangeModelContent(onEditorValueChange)
})
// destroy editor
Expand Down

0 comments on commit a78453e

Please sign in to comment.