I have a project which has quite large files, ~55000 lines per file. (don't ask why)
Well, anytime I try to copy (!! Not paste !!) a part of text in a .CS
file, I'm getting a dialog box saying Formatting
which stays for 3-5 seconds. Is getting pretty frustrating.
Is there an option to disable this?
The solution was to go to 'Tools > Options > Text Editor > Basic > VB Specific' and turn 'Pretty Listing' OFF.
tip. Even if auto-formatting or auto-indenting on paste are enabled, you can paste code without reformatting it: press Ctrl+Z right after pasting, and only formatting will be undone. Note that by default, Visual Studio applies its own formatting rules for edited and pasted code.
Use vs-code default shortcut keys ctrl+k with ctrl+shift+s (windows) for saving without formatting. Alternatively press ctrl+shift+p and search for save without formatting.
To access this options page, choose Tools > Options from the menu bar. In the Options dialog box, choose Text Editor > C# > Code Style > Formatting.
You may disable through the following:
Options -> Text Editor -> C# -> Formatting -> "Automatically format on paste"
(You can typically find the "Options" button under the "Tools" and/or "Debug" menu depending on your user interface configurations)
This will improve performance a bit. But, it is known bug after the last update and you won't be able to copy immediately.
ilkerkaran's solution didn't work for me, so I kept Googling and found out this is part of the Productivity Power Tools extension. Far from increasing my productivity, it prevented me from copy/pasting my code entirely!
Here's the solution I found:
Go to Extensions > Manage Extensions > Search for HTML
> Copy As HTML > Disable
Then, restart Visual Studio. It seems to have fixed this problem for me after YEARS of dealing with this thinking there was no solution after the above solution didn't work!
(this is a link to what clued me in: https://developercommunity.visualstudio.com/content/problem/251912/htmlcopy-formatting-document-for-copying.html)
This answer is specific to Visual Studio Community 2019, your mileage may vary.
Note: This precludes the need to turn off format on paste, which is a feature I quite like.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With