Skip to content

Commit

Permalink
Added actions to the context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
GoryMoon committed Sep 11, 2024
1 parent 0089b30 commit fd8f312
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ const handleMount = async (editor: monacoEditor.editor.IStandaloneCodeEditor, mo
editor.addAction({
id: 'editor.action.minfiyDocument',
label: 'Minfiy sNBT',
contextMenuGroupId: '1_modification',
contextMenuOrder: 98,
run(editor, ..._args) {
const model = editor.getModel();
Expand All @@ -161,6 +163,8 @@ const handleMount = async (editor: monacoEditor.editor.IStandaloneCodeEditor, mo
editor.addAction({
id: 'editor.action.escapeString',
label: 'Minify and Escape',
contextMenuGroupId: '1_modification',
contextMenuOrder: 99,
run(editor, ..._args) {
const model = editor.getModel();
Expand All @@ -176,6 +180,8 @@ const handleMount = async (editor: monacoEditor.editor.IStandaloneCodeEditor, mo
editor.addAction({
id: 'editor.action.unescapeString',
label: 'Unescape and Format',
contextMenuGroupId: '1_modification',
contextMenuOrder: 97,
run(editor, ..._args) {
const model = editor.getModel();
if (model == null) return
Expand Down

0 comments on commit fd8f312

Please sign in to comment.