Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Trim whitespace

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
tatou100 Posted - Oct 02 2009 : 1:19:29 PM
It would be a nice feature to add the possibility to trim trailing whitespace when a file is saved. That's something that most text editor do and visual studio don't.
7   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 24 2015 : 7:33:40 PM
Unfortunately we still don't have any plans to add this feature to VA. We are focussing more on refactoring and other features and bug fixes that directly effect code editing.

This is getting into the area of code formatting. It's something people are interested in, but just about everyone who is interested wants something different.
almo Posted - Nov 24 2015 : 10:13:06 AM
I want this feature in Visual Assist. It's not a default option in VS (still), and I don't want to have to download a plugin just to take care of this basic thing that even freeware text editors deal with.

And no, I don't want to have to search and replace something to do this. I should be able to have this automatically.
legalize Posted - Oct 06 2009 : 4:52:04 PM
Macros in VS.NET are compiled VB.NET code. The first time you run the macro its first compiling the macro to MSIL and then JIT compiling that to native code. Subsequent macro runs are fast because it uses the already JIT compiled code for the macro.

If a Macro is too slow, you could create an add-in that monitors the file save event and trims trailing whitespace right before save.

However, I just periodically purge trailing whitespace from files I'm editing with the Replace in Files regex that I posted earlier. The whitespace has a tendency to come back slowly, mostly because of auto-indenting leaving leading tabs on empty lines.

Once you purge the trailing whitespace globally from your solution, you shouldn't have to purge it too often after that. I do global purges of trailing whitespace and commit the changes as a single isolated commit across the whole project, usually with a log message of "crush trailing whitespace" or something similar.

I've never found it to be so frequent a problem that I even bothered coding a VS.NET macro for it.
tatou100 Posted - Oct 05 2009 : 12:24:23 PM
Thanks for your suggestion. We will try it this way :)
feline Posted - Oct 03 2009 : 12:22:50 PM
I did consider suggesting an IDE macro that uses find and replace, but then you would have to manually trigger the macro every time you wanted to run it. There might be some performance issues here, since for me the first time I trigger an IDE macro after loading the IDE it takes ages to run. Subsequent runs of the same macro are fast.
legalize Posted - Oct 02 2009 : 6:56:57 PM
In VS.NET, you can do this with Replace in Files...

Replace :b+$ with empty string.
feline Posted - Oct 02 2009 : 2:35:53 PM
This is not really something VA is going to do, but you could use a command line utility to do this, and set it as a custom build step, so all files have their white space trimmed before compiling.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000