Monaco-editor: Paste

Created on 29 Apr 2020  路  8Comments  路  Source: microsoft/monaco-editor


When I right click I should be able to 'paste' what i copied or cut. simple.

Most helpful comment

  1. as soon as we do a new release with the "August" bits of VSCode
  2. this relies on navigator.clipboard.readText support from the browser
  3. yes a prompt will appear if navigator.clipboard.readText is triggered

But maybe Alex can chime in too.

All 8 comments

@baubeis, try adding action to the editor with addAction api.

For a starting point refer to this example in the playground.

https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-adding-an-action-to-an-editor-instance

I think with @alexdima work recently this works now:

image

@bpasero Can you please share the link to the above image that you have mentioned ?

I think with @alexdima work recently this works now:

image

Yeah the related issue in vscode is: https://github.com/microsoft/vscode/issues/82604

@bpasero ,
I went through this PR Link

I have certain doubts regarding this ,

  1. When will this be available in monaco-editor ?
  2. Will this paste the text copied from anywhere (say as content from some other browser tab) ?
  3. Will this prompt about permission like how this website of google chrome does ?
  1. as soon as we do a new release with the "August" bits of VSCode
  2. this relies on navigator.clipboard.readText support from the browser
  3. yes a prompt will appear if navigator.clipboard.readText is triggered

But maybe Alex can chime in too.

That is correct, this will come out with the editor August release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

inf9144 picture inf9144  路  3Comments

fabiospampinato picture fabiospampinato  路  3Comments

ststeiger picture ststeiger  路  3Comments

aarinsmith picture aarinsmith  路  3Comments

akosyakov picture akosyakov  路  3Comments