Hi there.
Is there a way to make TextMate right-trim lines (e.g., remove tailing spaces in the end of lines)? I'm getting warnings from pep8.py (which checks if your code follows the PEP8) and looks like TextMate leaves a lot of spaces on empty lines inside and indented code.
Ideas?
On Jul 29, 2008, at 12:31 AM, Julio Biason wrote:
Hi there.
Is there a way to make TextMate right-trim lines (e.g., remove tailing spaces in the end of lines)? I'm getting warnings from pep8.py (which checks if your code follows the PEP8) and looks like TextMate leaves a lot of spaces on empty lines inside and indented code.
Ideas?
Yes, there's a command in the Text bundle:
“Remove Trailing Spaces in Document / Selection”
On Tue, Jul 29, 2008 at 8:50 AM, Alex Ross tm-alex@rosiba.com wrote:
Yes, there's a command in the Text bundle:
"Remove Trailing Spaces in Document / Selection"
Ah, cool. Now... is there a way to automate this? Like cleaning the document before saving (or better yet, prevent textmate to leave the lines empty.)
Julio Biason wrote:
Ah, cool. Now... is there a way to automate this? Like cleaning the document before saving (or better yet, prevent textmate to leave the lines empty.)
Make a new macro. Run the “remove trailing spaces” command. Then save.
Save your macro, and give it a shortcut of ⌘S
-Jacob
On Tue, Jul 29, 2008 at 11:10 AM, Jacob Rus jacobolus@gmail.com wrote:
Make a new macro. Run the "remove trailing spaces" command. Then save.
Save your macro, and give it a shortcut of ⌘S
Works like a charm. ;)
It's a little bit annoying that it removes the syntax highlight when saving now, but I guess I can live with that.
On Tue, Jul 29, 2008 at 11:10 AM, Jacob Rus jacobolus@gmail.com wrote:
Make a new macro. Run the "remove trailing spaces" command. Then save.
Save your macro, and give it a shortcut of ⌘S
Sorry to bring this again, but it seems that this is not working, actually.
The text gets properly cleaned, but the save command doesn't happen anymore. I tried to recreate the macro (weird thing, I didn't added the save the first time and it was working fine) doing the whole "Bundle -> Text -> Filter -> Trim document & Save", but still it doesn't save the file anymore.
Maybe some changed in the latest bleeding edge?
2008/7/31 Julio Biason julio.biason@gmail.com:
On Tue, Jul 29, 2008 at 11:10 AM, Jacob Rus jacobolus@gmail.com wrote:
Make a new macro. Run the "remove trailing spaces" command. Then save.
Save your macro, and give it a shortcut of ⌘S
Sorry to bring this again, but it seems that this is not working, actually.
The text gets properly cleaned, but the save command doesn't happen anymore. I tried to recreate the macro (weird thing, I didn't added the save the first time and it was working fine) doing the whole "Bundle -> Text -> Filter -> Trim document & Save", but still it doesn't save the file anymore.
Maybe some changed in the latest bleeding edge?
No it doesn't work using the normal Save command in the macro.
You need to create a new bundle command set to Save: Current file Input: None Output: Discard And use this instead when recording the macro.