Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy+Paste Plain Text #161

Open
cawoodm opened this issue Feb 6, 2024 · 5 comments
Open

Copy+Paste Plain Text #161

cawoodm opened this issue Feb 6, 2024 · 5 comments

Comments

@cawoodm
Copy link

cawoodm commented Feb 6, 2024

When pasting CSV text from VS Code to, say, Excel it pastes as HTML i.e. colored text with a specific font.
This is undesirable behaviour in most cases - we want code highlighting but not the pasting of code colors to other windows.

image

@mechatroner
Copy link
Owner

I think most operating systems should allow to paste without color/formating e.g. Ctrl + Shift + V in windows (instead of Ctrl + V) or Cmd + Shift + V in Mac OS.
Please let me know if this helps.

@masebu
Copy link

masebu commented Apr 2, 2024

Hi,

It may also depend on the target software.

ex. on windows 10/11, Ctrl+Shift+V does indeed remove formatting when pasting in Excel (as required above) or a rich text edit box on a website.
MS Word ignores Ctrl+Shift+V; a regular paste is required, then choose paste option "keep text only".

Regards

@mechatroner
Copy link
Owner

Thank you for the correction, @masebu, you are right, it depends on the destination software.
I also investigated it a little bit more, and it turns out this apparently can also be configured at the source, in VSCode specifically whether to copy formatting or plain text only is governed by the editor.copyWithSyntaxHighlighting setting: https://stackoverflow.com/questions/44461520/how-to-turn-off-copy-with-syntax-highlighting. So I might be able to do something on the extension side, at least I can add a doc entry on how to adjust this behavior.

@mechatroner
Copy link
Owner

It is also possible to disable editor.copyWithSyntaxHighlighting for all csv files by default at the extension level, but I am not sure if this is the right thing to do, since it would be inconsistent with the other filetypes.

@ksvnar
Copy link

ksvnar commented Apr 27, 2024

Очень хорошо спасибо вам

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants