darkriszty / MarkdownTablePrettify-VSCodeExt

Visual Studio Code extension to prettify markdown tables.
MIT License
64 stars 3 forks source link

Paste doesn't work in MD files #42

Closed yaagma closed 3 years ago

yaagma commented 4 years ago

Steps to reproduce this bug:

  1. Copy some text (Ctrl+C).
  2. Write anything in a line and press Ctrl+V (paste).

Before the text is pasted, all the previous characters in that line are also duplicated.

Thanks Raúl

darkriszty commented 4 years ago

Hi @yaagma,

First of all, thanks for trying out the extension and taking the time to report an issue!

This extension is not doing anything during copy-paste operations. Formatting is only applied during an operation explicitly triggered by the user: Format document, Format selection, Prettify markdown tables or any keyboard shortcuts associated with these. The default keyboard shortcut for the built-in Format document is SHIFT + ALT + F, while for the custom Prettify markdown tables it is CTRL + ALT + M.

I am not able to reproduce the problem you described. These are the steps I took:

Result: the text is being pasted normally every time, without any duplication.

I think either some keyboard shortucts that you have configured or another extension is interfering. Could you please check your keyboard shortcuts and retry this will all other extensions disabled? Let me know if the issue still persists afterwards, and if yes, please provide more details on how I could reproduce it (for instance: VS Code version, extension version, OS platform, more detailed steps and concrete file and clipboard contents).

Thanks!

yaagma commented 4 years ago

Thank you for responding so quickly. I need a few days, but I will try to create a minimal environment with portable VSC and try to reproduce the error in a isolated environment.

Thanks for all.

danmactough commented 3 years ago

+1 on this report. With this extension enabled, every paste operation (in a document in any language, not just Markdown) appears to paste the entire line of the selection that was copied rather only the selection. Disabling or removing this extension fixes this behavior.

darkriszty commented 3 years ago

Hi @danmactough, thanks for your input. This is pretty bizarre as I'm still not able to reproduce it and I also cannot think of a reason behind this behavior.

paste

Could you please provide more details? For instance:

Thanks!

yaagma commented 3 years ago

I found it!!

Steps I followed:

If I change it to false, the bug goes away.

In summary, the steps to reproduce the error are:

  1. Introduce in the clipboard any text (for example, "123").
  2. Set "editor.formatOnPaste" to true.
  3. Create an empty md file,
  4. Type anything in the first line (for example "abc").
  5. Paste (Ctrl + v). Instead of "abc123", you get "abcabc123" (repeats de line content before pasting).

I hope this helps.

OS platform. Windows 10 VS Code version. Tested in 1.46.1 and 1.50.1 Extension version. v3.0.0 Concrete clipboard contents. 123 Concrete line contents where this happens during paste. a \n \b \n Any other extra steps/info that might help.

darkriszty commented 3 years ago

Thanks, this has been a huge help! I will include a fix in the next release.

darkriszty commented 3 years ago

Thanks again to both of you for reporting! The fix is included in v3.1.0; it should show up as an extension update in VSCode.

danmactough commented 3 years ago

Confirmed working @darkriszty! Thanks for the quick fix! 💖