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 code in vscode, then paste into Evernote or Word, the indents will disappeared #72556

Closed
sunwin123 opened this issue Apr 18, 2019 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-clipboard Editor clipboard issues

Comments

@sunwin123
Copy link

  • VSCode Version: newest version.
  • OS Version: Windows 10.

Steps to Reproduce:

1.When {Editor:Detect indentation} is set Off, then you type codes in vscode editor with tab indent, then select & copy the codes, then paste it in other applications such as Word/Evernote, the indentations disappear!
2. However, When {Editor:Detect indentation} is set On, then you type codes in vscode editor with tab indent, then select & copy the codes, then paste it in other applications such as Word/Evernote, the indentations are there!
3. So, it is certainly an issue of VSCode! Not of other applications.

Does this issue occur when all extensions are disabled?: Yes/No

@vscodebot vscodebot bot added the editor-autoindent Editor auto indentation issues label Apr 18, 2019
@sunwin123
Copy link
Author

I find another thing:
When paste into Plain text editors, indents will not disappear.
When paste into Rich text editors, indents disappear!

So, I think it shouldn't be an issue of those other rich text editors. It is of VSCode.

@sunwin123
Copy link
Author

It is really a big problem for many programmers, they usually use copy/paste code into their blogs or notes.

@alexdima alexdima added editor-clipboard Editor clipboard issues and removed editor-autoindent Editor auto indentation issues labels May 8, 2019
@alexdima alexdima assigned rebornix and unassigned alexdima May 8, 2019
@rebornix rebornix added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 31, 2019
@vscodebot
Copy link

vscodebot bot commented Jul 31, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Jul 31, 2019
@vsxen
Copy link

vsxen commented Aug 28, 2019

Yes, when you use Space indentation in your code, the idents will lost in OneNote, but use Tab indentation is normal.
So you'd better convert indents to Tabs in VSCode before copy:

Click ctrl + shift + p
Find command Convert Indentation to Tabs
Execute it and then copy your code to OneNote

#35954 (comment)

@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-clipboard Editor clipboard issues
Projects
None yet
Development

No branches or pull requests

4 participants