[TxMt] Re: Save and strip whitespace

Ale Muñoz bomberstudios at gmail.com
Mon Apr 2 09:50:09 UTC 2012

On 01/04/2012, at 15:48, John Yeates wrote:

> This bundle seems to have stopped working in build 9110: it doesn’t strip space in the buffer or saved file any more. Has anything changed that would cause the callback.document.did-save hook to stop working?

I'm starting to think it never actually worked properly...

Here's how the bundle works on my end (with 9110, on 10.7.3):

- Open a document
- Add some trailing whitespace
- Hit 'Save'
- The trailing whitespace is removed, and the file *seems* to be saved
  I say "seems", because the document icon goes from semitransparent to opaque, but what TextMate is saving is actually the file *with* the whitespace.

The command's semantic class is 'callback.document.did-save' and is set to Save: 'Current Document' (see attached screenshot)

It looks like it first saves the document, and then it runs the command (makes sense, but then we need a new semantic class: 'callback.document.before-save'). Still, there is a bug with TM2, as it doesn't show the document as modified after running the command.

I've gotten used to hitting Command + S two times in a row to remove whitespace and have it saved on disk, but it's a pretty crappy solution and doesn't actually solve the problem when using the 'Save on Focus Lost' bundle.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2012-04-02 at 11.43.18.PNG
Type: image/png
Size: 42576 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20120402/7b4473ab/attachment-0001.PNG>

More information about the textmate mailing list