[TxMt Plugins] Re: Altering Line Endings

Allan Odgaard mailinglist at textmate.org
Thu Aug 9 21:53:00 UTC 2012

On Jul 26, 2012, at 12:12 AM, Rob Brackett <rob at robbrackett.com> wrote:

> I recently spent some time working on a plugin (https://github.com/Mr0grog/editorconfig-textmate) to support EditorConfig (http://editorconfig.org).

Neat, I didn’t know about this, looks very similar to the .tm_properties system we have in 2.0.

> […] Looking into TextMate, OakDocument has -lineEnding and -setLineEnding. Are these the right methods to call? What should I pass to them? (Calling -lineEnding always just gave me back nil whenever I tried it.)

The lineEnding property is a C enumeration:

    enum line_ending_t { kLF = 0, kCR, kCRLF };

So you should get back 0, 1, or 2 back. Normally 0 for kLF.

> I know all the work is happening on TM2 right now (this is currently written to work against TM1), but I'd like to get it working for both versions.

For 2.0 the internals are completely different, but it sounds like this should just be added to the current settings stuff (that already reads .tm_properties files per folder, where a line ending setting do exist).

If you haven’t heard yet, the source is now available¹, which should make it easier, should you wish to look into this.

Kind regards Allan

¹ https://github.com/textmate/textmate

More information about the textmate-plugins mailing list