[TxMt] Re: Perl, don't indent pod code?

Allan Odgaard mailinglist at textmate.org
Tue Nov 5 14:30:57 UTC 2013


On Nov 5, 2013, at 13:56, Justin Catterall <100621.1 at masonsmusic.co.uk> wrote:

> Looking for help with language grammar. Coding in perl, and adding pod (documentation) within a codeblock, pod code gets automatically indented. Is there a way to have lines that begin with a = symbol auto- 'out-dent'? And then any subsequent lines, before a '=cut' line to be indented to match the previous line?

I assume decrease indent only by a single unit? If so, you can make the line be matched by both the increase and decrease indent pattern, e.g.:

    increaseIndentPattern = '^\s*=\w+';
    decreaseIndentPattern = '^\s*=\w+';

This should give the behavior. Note though that if the indent is zero when the cut line is used, the current build will not cause the indent to be increased for the following lines, but this will be fixed in next build.

Also, we disable indent-as-you-type for source.comment, so if you setup useful indent patterns for the documentation blocks (which I assume are scoped as block comments) then it might be useful to re-enable indent-as-you-type:

    disableIndentCorrections = :false;



More information about the textmate mailing list