I am using AS3 Bundle.
There is a difference between how the indentation rules work with TM1.5 and TM2.0.
In TM2.0 a new indent is applied each time I type a carriage return - where there was no ending ‘;' In TM1.5 is lined up with the previous line - even where there was no ending ‘;’
The new behaviour (TM2) is quite annoying and really slows down my work, as I do not use the optional ‘;’ in as3.
I have checked the AS3 bundle rules on TM1.5 and TM 2.0 and they are the same.
Why is it different, or rather how can I fix it, please?
These are the rules. They are the same, just in a different order – and I have swapped order to see if it makes any difference. it does not.
//IN TM1.5
{ decreaseIndentPattern = '^(.**/)?\s*}([^}{"'']*{)?[;\s]*(//.*|/*.**/\s*)?$|^\s*(public|final|dynamic|internal):\s*$'; increaseIndentPattern = '^.*{[^}"'']*$|^\s*(public|final|dynamic|internal):\s*$'; indentNextLinePattern = '^(?!(.*[};:])?\s*(//|/*.**/\s*$)).*[^\s;:{}]\s*$'; }
//in TM2
{ increaseIndentPattern = '^.*{[^}"'']*$|^\s*(public|final|dynamic|internal):\s*$'; decreaseIndentPattern = '^(.**/)?\s*}([^}{"'']*{)?[;\s]*(//.*|/*.**/\s*)?$|^\s*(public|final|dynamic|internal):\s*$'; indentNextLinePattern = '^(?!(.*[};:])?\s*(//|/*.**/\s*$)).*[^\s;:{}]\s*$'; }
On 12 May 2020, at 21:37, Simon Lucas wrote:
Why is it different, or rather how can I fix it, please?
The change is that TextMate 1.x only used the rules after you press return (to estimate indent of the new line), where 2.x also does it when you make an edit to a line, that makes the rules think it should now be indented differently.
Can you provide a sample AS3 file in your style? Then we should be able to update the rules to support this.
As a temporary workaround, in `~/.tm_properties` you can add this section:
[ source.actionscript ] disableIndentCorrections = true
This will disable indent corrections for AS3 files.
You can also set it to `emptyLines` instead of `true`. Then it is only when you type on an empty line, that it disables the corrections.
Allan, thank-you for looking at this
link to my latest .as file
https://we.tl/t-PDGIGWcQN6 https://we.tl/t-PDGIGWcQN6
I tried to add the .tm_properties file to the ~ folder, but the indents are still operating.
On 16 May 2020, at 03:18, Allan Odgaard mailinglist@textmate.org wrote:
On 12 May 2020, at 21:37, Simon Lucas wrote:
Why is it different, or rather how can I fix it, please?
The change is that TextMate 1.x only used the rules after you press return (to estimate indent of the new line), where 2.x also does it when you make an edit to a line, that makes the rules think it should now be indented differently.
Can you provide a sample AS3 file in your style? Then we should be able to update the rules to support this.
As a temporary workaround, in ~/.tm_properties you can add this section:
[ source.actionscript ] disableIndentCorrections = true This will disable indent corrections for AS3 files.
You can also set it to emptyLines instead of true. Then it is only when you type on an empty line, that it disables the corrections.
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
On 16 May 2020, at 18:00, Simon Lucas wrote:
Allan, thank-you for looking at this
link to my latest .as file
Finally found time to look at this, but your link has expired :(
However, looking at the patterns you were using, the “indent next line” pattern basically matches all lines, you can copy/paste that regular expression into the find dialog (enabling regular expression), and you will see that it matches most lines in a file, and that is why you get the extra indent.
This pattern is not in the default ActionScript bundle.