-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.95.3
- OS Version: Manjaro Linux
Steps to Reproduce:
- I start with this code:
- Then I start adding this:
- I copy this portion of code from above:
- And I paste it here:
Expected behavior:
I should get this:
Observed behavior:
This is completely bonkers! Not only is this not sensible indentation, but crucially, the pasted code alters the contents of the string!!!!!!
Sometimes, when pasting a multi-line string into a region of code with different indentation than the one the original string was copied from, one doesn't get the desired indentation and that's expected because the contents of the string are sacred. The IDE doesn't know whether the whitespaces inside the string matter, so, at least by default, it preserves the contents of the string at the expense of indentation. And that's expected.
But here, the resulting indentation makes no sense AND the contents of the pasted string are altered with respect to the copied one!! This makes no sense whatsoever! The indentation of the code where the new code is pasted is the same as where the code is copied from, so there's no need to alter the indentation in the first place, but the IDE is removing spaces for no reason whatsoever AND it's changing the contents of a pasted string, even unnecessarily.