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

When copying to OneNote, the spaces used for indentation disappear #35954

Closed
hnlxl opened this issue Oct 10, 2017 · 15 comments
Closed

When copying to OneNote, the spaces used for indentation disappear #35954

hnlxl opened this issue Oct 10, 2017 · 15 comments
Assignees
Labels
editor-clipboard Editor clipboard issues under-discussion Issue is under discussion for relevance, priority, approach upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@hnlxl
Copy link

hnlxl commented Oct 10, 2017

  • VSCode Version: Code 1.17.0 (be377c0, 2017-10-04T23:45:46.804Z)
  • OS Version: Windows_NT x64 10.0.15063
  • Extensions:
Extension Author (truncated) Version
vscode-eclipse-keybindings alp 0.9.6

I submitted an issue #35288 before. It's been closed because it's written in Chinese, so I re-submit in English. My English is not good, so I use screenshots more.

Indent using spaces
image

When copy to OneNote(desktop version) ,The spaces are gone
image

If "Indent using tabs", there is no problem.
image

Reproduces without extensions: Yes/No

@egamma
Copy link
Member

egamma commented Oct 10, 2017

The text is stored properly in the clipboard and I cannot reproduce this in Word (see below). So this looks like a OneNote specific behaviour. Nothing we can addresson the side of VS Code.

image

@hnlxl
Copy link
Author

hnlxl commented Oct 11, 2017

I guess the content is HTML format when copy to clipboard from VS Code. When copying content to OneNote, the performance is usually normal. Sometimes it is not normal if the content has special formats. Whether can check the code display HTML.
When I search online, I found that when copying code with highlighting from IDE to Onenote, the disappearance of spaces for indentation is frequent.
This is not urgent. Now I can first convert indentation to Tabs for copying to OneNote, then undo.

@rebornix rebornix added under-discussion Issue is under discussion for relevance, priority, approach upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Nov 16, 2017
@rebornix rebornix added editor-clipboard Editor clipboard issues and removed editor labels Sep 18, 2018
@qodesmith
Copy link

Any movement on this? Pasting into Evernote strips all the spacing :/

@BrambleXu
Copy link

Same issue here. Pasting code to Evernote but no indention.

@qodesmith
Copy link

Looks like pasting into Evernote is working now. Spaces are retained. @BrambleXu what version of EN are you using? I'm using the Mac client and it says version 7.8. Also, I'm using VS Code version 1.30.2 for Mac as well. Perhaps updating both to the latest version will solve this for you.

@qodesmith
Copy link

@BrambleXu Not sure if its relevant, but I use a monospace font in EN for everything. Just figured I'd mention it.

@BrambleXu
Copy link

@qodesmith I am using latest Evernote and VS code just like you. I also tried to use the monospace font in EN. But the problem still exists.

@yume-chan
Copy link
Contributor

It works for users who uses Tab as indentation, not Spaces

I believe it's caused by how these programs handle spaces in HTML, actually if you copy the following line and paste it in OneNote, the leading spaces will also be trimmed.

    copy me!

@BrambleXu
Copy link

BrambleXu commented Feb 4, 2019

@yume-chan Thanks, it works for Evernot, but only with Tab indentation.

@kio21
Copy link

kio21 commented Feb 4, 2019

This is not the VSCode issue. This is OneNote issue. It has very poor attention at OneNote Suggestions place. https://onenote.uservoice.com/forums/327186-onenote-for-windows/suggestions/33254596-rich-text-paste And sadly to say it tends to be never fixed. (Probably there are other similar issues there - I see many duplicates for the missed line spacing option).

@BrambleXu
Copy link

BrambleXu commented Feb 4, 2019

As for Evernote, this is the VS code issue. If setting indention with space in VS code, and pasting to Evernote, it would lose the indention. Other editors have no such problem.

image
Here is the link

@ghost
Copy link

ghost commented Feb 4, 2019

Interestingly, if the paste function is done with the "Keep Text only" option the formatting obviously disappears but the indentation remains.
PS: The problem also occurs in the new OneNote UWP app for Windows 10.

@sunwin123
Copy link

This is not the VSCode issue. This is OneNote issue. It has very poor attention at OneNote Suggestions place. https://onenote.uservoice.com/forums/327186-onenote-for-windows/suggestions/33254596-rich-text-paste And sadly to say it tends to be never fixed. (Probably there are other similar issues there - I see many duplicates for the missed line spacing option).

Man, this is really a VSCode issue!
When Editor:Detect indentation is Off, then you type codes in vsc editor, then copy the codes, then paste in many other applications such as Word/Evernote, the indentations are lost!
But if Editor:Detect indentation is On, then do the same things, the indentations are there, not lost!
So, This is an issue of vscode, not of Evernote.

Developers of vscode, fix this issue asap please... Thanks a lot!!!

@sunwin123
Copy link

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.

@enify
Copy link

enify commented Jul 7, 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-clipboard Editor clipboard issues under-discussion Issue is under discussion for relevance, priority, approach upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

10 participants