[TxMt] saving without trailing spaces and tabs...

Dan Ridley danridley at mac.com
Tue Mar 21 22:50:59 UTC 2006


On 21 Mar 2006, at 14:06, Allan Odgaard wrote:

> If you set the command to save before, it will think the file is up- 
> to-date (even though the command makes a second save), and if you  
> set the output to discard, you should get rid of the latter problem  
> (then also remove the » && cat "$TM_FILEPATH"«).

The downside to that is the fact that the file on disk won't quite  
match up with the editor view. The trailing spaces will be removed in  
the file on disk, but TextMate won't know that, and will continue to  
display them until you reopen the file.

This might not be a problem (the original poster mentioned that the  
trailing spaces caused him trouble when he took the same files to vi,  
so as long as the saves always happen without trailing spaces it  
might be fine).

> It does however not handle the case where the file is untitled.

Good catch. The macro solution (using a second empty command with  
"Save File" set)  handles this situation just fine, which is another  
argument in favor of that method.




More information about the textmate mailing list