When I copy code form VS Code to OneNote, indentation is lost.
Example:
This is how code on VS Code looks like:
When it's pasted to OneNote, it looks like this (indentation is lost):
I wonder is there any way to copy code to OneNote without losing indentation.
Tried actions that didn't solve the problem:
-
Converting indentation to tabs or spaces on VS Code doesn't work.
-
if you use "spaces" for your indentation then change that to
"tabs"using the below steps and then copy the code to oneNote.Steps:
- 'ctrl + shift + p'
- find command "convert indentation to tabs"
-
copy the code and paste it in oneNote
quote from Dark Light's answer
-
Side observations:
Best Answer
if you use "spaces" for your indentation then change that to "tabs"using the below steps and then copy the code to oneNote.
Steps:
This works for me.