mushanshitiancai / vscode-paste-image

paste image from clipboard to markdown/asciidoc directly!
MIT License
422 stars 127 forks source link

Speed up insertion #79

Open max92334 opened 3 years ago

max92334 commented 3 years ago

Currently there is a lag of about 2s between ^C-S-v and the insertion of the image. For example, when I try to insert an image after "image", but continue typing, the image is inserted in the middle of a random word:

The image ^C-S-v shows a picture of a dog fetching a ball

will not insert the image when the ^C-S-v command is executed, but roughly 2s later, resulting in

The image shows a picture of a dog fetc![](img.png)hing a ball

I am using win32, but the way the code is structured this probably happens on the other platforms as well.

Would it be possible to immediately insert the image string into the file, and then run saveClipboardImageToFileAndGetPath asynchronously in the background?