I'm using monaco editor for my project and I can be able to emit editor events for undo/redo actions like so:
editor.getModel().redo();
editor.getModel().undo();
This is a very common editor, so I think there should be cut/copy/pase actions also, but unfortunately, I don't see similar actions like editor.getModel().cut.. e.t.c.
What have I missed?
You can trigger editor actions to copy/paste:
editorInstance.trigger('source','editor.action.clipboardCopyAction');
editorInstance.trigger('source','editor.action.clipboardPasteAction');
Actions available can be listed with: editorInstance.getActions().map(a => a.id)
I still haven't figured out what effect the first argument to trigger has, so I have simply provided a string that suggests what triggered the action.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With