Monaco-editor: How do I insert text at the cursor position of the mouse?

Created on 15 Sep 2017  路  3Comments  路  Source: microsoft/monaco-editor

monaco-editor version: 0.10.0
Browser:Google Chrome
OS: windows 7
////
How do I insert text at the cursor position of the mouse?

Most helpful comment

I use this

editor.trigger('keyboard', 'type', {text: "test"});

All 3 comments

Temporary solution

    editor.executeEdits("", [{
    range:{startLineNumber:editor.getPosition().lineNumber,startColumn:editor.getPosition().column,endLineNumber:editor.getPosition().lineNumber,endColumn:editor.getPosition().column},
      text: "test"
    }]);


Is there a better way?

I use this

editor.trigger('keyboard', 'type', {text: "test"});

@H3dz Thank you very much. I have solved the problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spotqa-josem picture spotqa-josem  路  3Comments

aarinsmith picture aarinsmith  路  3Comments

ststeiger picture ststeiger  路  3Comments

chengtie picture chengtie  路  3Comments

PinkyJie picture PinkyJie  路  3Comments