Reindent (was: [SVN] Revision 2002 (Source))

Allan Odgaard throw-away-1 at macromates.com
Mon Oct 24 23:15:12 UTC 2005


On 25/10/2005, at 0.46, Chris Thomas wrote:

>> Placing the command in the source bundle will automatically have  
>> Support/bin in the path, although the script seems to not be  
>> executable (and each svn up removes the x bit).
> Need to set the svn:executable property?

That did it, thanks.

Btw: the re-indent C/C++/Obj-C source is now:

     if [[ $TM_SOFT_TABS = "YES" ]];
        then tab_settings="-I $TM_TAB_SIZE"
        else tab_settings="-t"
     fi

     reindent.rb $tab_settings \
      -i '^.*\{[^}"'']*$' \
      -d '^(.*\*/)?\s*\}[;\s]*$' \
      -n '^(?!.*;\s*//).*[^\s;{}]\s*$' \
      --skip-line '^\s*((/\*|//|#|@interface|@implementation|@end).*)?$'

It seems to work very well, though I haven't nailed case/break yet,  
and there are some problems when a line has comment start/stop  
markers in the leading indent (which I _think_ could be fixed by  
extending the number of patterns, but I'm not entirely sure yet).




More information about the textmate-dev mailing list