-
-
Notifications
You must be signed in to change notification settings - Fork 456
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
Weird auto-formatting of code upon paste #245
Comments
Yep same thing happens by calling the range formatter (Format selection). FormatOnPaste calls the range formatter. It messes the output if the trailing-comma is selected/pasted. |
I experience the same, also added a gif inside another issue because I first thought VS code was causing the behaviour. microsoft/vscode#33522 |
This should be fixed in prettier 1.8 (version we are now bundling) |
I'm still experiencing this issue with the latest extension 1.5.0 |
Me too in VSCode! |
I think |
"editor.formatOnPaste": false did not fix my issue.. the way it imports and formats is whack, but undo fixes it. |
This worked for me: Go to VS Code Settings -> from the User Settings tab -> Text Editor -> Formatting -> Untick the first option 'Format On Paste' |
same issue, very annoying |
Thanks @faiz021 , that worked for me |
This was driving me insane. Found the config and turned it off and I'm happy again :) Of course, now I find the fix here :) |
This is still an outstanding issue on 1.9.0. |
My "Format on Paste" is disabled since long time ago, but I still experience this! |
Still happening... this is so annoying. |
I am setup "editor.formatOnPaste": true, and this is fix my issue. I am use Prettier + ESLint + Airbnb Style Guide VS Code v1.36.1 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
In JS files this extension will sometimes mess up indentation upon pasting. The circumstances under which this seems to happen is when having
"editor.formatOnPaste": true
enabled (something that Atom Keymap adds to your config automatically).With prettier extension disabled:
This is when having prettier disabled. I start out by marking the text and pressing CMD+C, place the cursor where I want to paste, and CMD+V. Everything pastes as one would expect.
With prettier extension enabled and including trailing comma
This is after enabling prettier. Again, I mark the text, copy it, paste it. Split second after pasting prettier has formatted everything in a horrific manner.
With prettier extension enabled an excluding trailing comma
I then found out that if I do not mark the last comma in the selection I want to copy+paste, it works even with prettier enabled.
Snippet:
My config:
The text was updated successfully, but these errors were encountered: