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

Copying and pasting tabbed content not working since update. #32431

Closed
JonCognioDigital opened this issue Aug 13, 2017 · 3 comments
Closed

Copying and pasting tabbed content not working since update. #32431

JonCognioDigital opened this issue Aug 13, 2017 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) editor-autoindent Editor auto indentation issues editor-clipboard Editor clipboard issues

Comments

@JonCognioDigital
Copy link

  • VSCode Version: July Update
  • OS Version: Win10

Steps to Reproduce:

  1. Find any HTML code with tab indentation
  2. Copy and paste code to a new line
  3. Indentation will be correct for first line but subsequent will be 4 spaces to the right of where they should be.

I spend a long time wondering whether there was a problem with my code, maybe an unclosed tag but then it started happening on all files, not just HTML files but js files too. It has been happening since I updated to the July update earlier today.

@vscodebot vscodebot bot added editor editor-autoindent Editor auto indentation issues labels Aug 13, 2017
@rebornix rebornix added editor-clipboard Editor clipboard issues bug Issue identified by VS Code Team member as probable bug labels Aug 15, 2017
@mikeseese
Copy link
Contributor

This is not just an HTML issue; I'm seeing it with Javascript as well. I think this is a generic issue with the clipboard/indentation of the editor and has been introduced recently.

I have seen this bug before in Atom (atom/atom#5473 is just one of the handful of bugs that describe this problem). It has to do with already indented content (as @jon64digital specified in step 1). I would love to see this fixed! I may look into fixing it for Hacktoberfest

@mikeseese
Copy link
Contributor

Turns out they turned on auto-indentation by default in the July update (https://code.visualstudio.com/updates/v1_15#_auto-indentation). I verified the behavior is no longer seen when I turn auto indentation off.

I'm not sure if this is how auto indentation is supposed to work, but it appears to happen depending on how previous lines are indented (very similar to the atom/atom#5473 issue). I don't think I'll attempt fixing this as I think there is some design choice that made the code act this way that I may get pushback in pushing if I found how to fix it.

I recorded some different use cases using different settings. You'll see me selecting text, I then copy it, and paste it. My VS Code version is 1.16.1

peek 2017-10-03 11-26

@rebornix
Copy link
Member

rebornix commented Dec 1, 2017

@seesemichaelj our indentation rules and logic may not work for every case at this moment, especially when everyone may have their own preference. But for the particular issue you posted in above gif, it's already fixed in Insider.

I made some changes to auto indent for pasting to mitigate the issue @jon64digital described. If there are other unexpected scenarios, please let me know, thanks in advance!

@rebornix rebornix closed this as completed Dec 1, 2017
@rebornix rebornix added the *duplicate Issue identified as a duplicate of another issue(s) label Dec 1, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) editor-autoindent Editor auto indentation issues editor-clipboard Editor clipboard issues
Projects
None yet
Development

No branches or pull requests

4 participants