tecosaur / LaTeX-Utilities

An add-on to LaTeX Workshop that provides some features that go beyond the bare essentials
MIT License
474 stars 28 forks source link

Formatted Paste doesn't work for image file #363

Closed dest1n1s closed 1 year ago

dest1n1s commented 1 year ago

Bug Report

Disable all the other extensions except for LaTeX Workshop and LaTeX Utilities, and check that you still see this issue.

You still see this issue?: Yes

Describe the bug

When using the formatted paste, I found that if I try to paste the image file (e.g. xxx.png), it always let me specify the filename of the image, and then tell me "No image in clipboard". However, if I try to copy the image content itself, it works fine.

To Reproduce

Steps to reproduce the behaviour:

  1. Go to File Explorer
  2. Select an image file
  3. Use Ctrl + V to copy the image (Or open it, right-click and click "Copy", which behaves the same)
  4. Go to Visual Studio Code, and open the Command Panel
  5. Click the "Latex Utilities: Paste formatted content"
  6. Input an arbitrary filename.
  7. And finally get a message of "No image in clipboard".

Expected behaviour

It should identify the image file in the clipboard, and paste proper content into the editor.

Logs

Both the LaTeX Workshop and the LaTeX Utilities does not log anything.

Desktop

leoleoasd commented 1 year ago

Hi dest1n1s:

Pasting image files isn't currently supported. You can draft a feature request on this, or a PR if you are interested in implementing it. In the meantime, we are going to add support for drag-and-drop images into the editor (see #358), I think this feature covers your use case.