Monday, March 25, 2013

You CAN eat this paste... well... kind of. Pretty Paste makes pasting into Visual Studio, well pretty [easy]!

.Net Slave - Introducing Pretty Paste for VS2012

Download Pretty Paste now!

One of the things that have annoyed me about Visual Studio for many years, is the inconsistency when pasting code copied from websites. Depending on the browser you get different results. Consider the code snippet below copied from one of Sayed’s blog posts.


If I copy that from Internet Explorer and paste it into Visual Studio, this is what I get:


And copied from Chrome result in this:


As you can see, both browsers include the line numbers, but they interpret them differently. Both browsers fail to understand my intent for copying the text and it has been that way forever. Very annoying. In tooling, understanding the user’s intent is the holy grail.

So, in a rare moment of clarity a few days ago, I decided to fix this issue by writing an extension for Visual Studio - Pretty Paste. The idea is to inject some logic just before the regular Paste command in VS executes. That logic will quickly analyze the text being pasted and correct any non-intended line numbers and extra blank lines.


Visual Studio Gallery - Pretty Paste

Fixes the issue where copied text introduces new blank lines and line numbers

Open source and pull requests accepted

Suggest features and report bugs here

Learn more about why Pretty Paste is a good idea.



Because I seem to be on this "paste" kick for some reason... Really, I write my code... really... :/

And I really appreciate that this is source available... :)


Related Past Post XRef:
Think maybe you do CTRL-V code too much? Here's a Visual Studio feature to help you (find those code clones, that is...)
If CTRL-V is your coding friend (admitted or not), Check out Paste FixR

No comments: