First, I just want to say how much I'm enjoying TM2. However, I'm seeing a problem with the indentation, and while I originally thought it was the Haskell bundle, I think it's really just TM2 being overly aggressive in correcting indentation.
If I tab in or delete indentation before typing anything on a new line, TM2 undoes my change in indentation when I start typing. if I start typing first, then I can change it with cmd-[ or cmd-], but cmd-[ or cmd-] doesn't do anything until I've typed something on the line.
So, say I have the following:
convert acc x
and I hit return after the x, TM2 puts me in column 0. If I hit tab to indent because I'm going to type a guard, I'm now at column 4. But as soon as I start typing the guard (which begins with a | character) I'm outdented to column 0 again. I can, of course, correct it with cmd-].
Also, if I simply paste some code in with the cursor in column zero, TM2 indents everything an extra tab. If I select the below and paste it into column 0 of a file whose language mode is set to Haskell, it all gets indented an extra tab.
myInt (x:xs) | x == '-' = -1 * myInt xs | otherwise = foldl convert 0 (x:xs) where convert acc x | x `elem` ['0'..'9'] = 10 * acc + digitToInt x | otherwise = error ("bad input: not an int - " ++ [x])
On Saturday January 07 2012, Allan Odgaard mailinglist@textmate.org wrote:
You can disable this. Make a new settings item in the bundle editor and scope it to Haskell, it should contain:
{ disableIndentCorrections = :true; }
How do you make a new settings item? The bundle editor appears to be entirely read-only for me…
(the identation correction has some very odd ideas about loop indentation in .html.erb files :)
On 9 January 2012 14:40, John Yeates textmate2@warmvomit.co.uk wrote:
On Saturday January 07 2012, Allan Odgaard mailinglist@textmate.org wrote:
You can disable this. Make a new settings item in the bundle editor and
scope it to Haskell, it should contain:
{ disableIndentCorrections = :true; }
How do you make a new settings item? The bundle editor appears to be entirely read-only for me…
(the identation correction has some very odd ideas about loop indentation in .html.erb files :)
Quick overview of changing settings would be really helpful for me too!
I've seen a fair few replies on the list about creating new settings or adding to the .tm_properties file - is there an overview anywhere of the basics as I'm finding it quite hard to get my head round where all these things are and which bit of the program they affect.
Thanks, Nigel
Cmd-n
Sent from my iPhone
On 9 Jan 2012, at 07:40 AM, John Yeates textmate2@warmvomit.co.uk wrote:
On Saturday January 07 2012, Allan Odgaard mailinglist@textmate.org wrote:
You can disable this. Make a new settings item in the bundle editor and scope it to Haskell, it should contain:
{ disableIndentCorrections = :true; }
How do you make a new settings item? The bundle editor appears to be entirely read-only for me…
(the identation correction has some very odd ideas about loop indentation in .html.erb files :)
-- John Yeates
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Allan Odgaard <mailinglist@...> writes:
You can disable this. Make a new settings item in the bundle editor and scope
it to Haskell, it should contain:
{ disableIndentCorrections = :true; }
I'm actually noticing the same sort of problem in CoffeeScript code. Perhaps the above setting isn't as extreme as it sounds, but turning off indent corrections entirely seems overkill.
For example, here's a sequence I hit quite a lot: 1) Hit return. 2) TM2 places the cursor at an indent position based on the bundle, etc. 3) I backspace, etc. to get the cursor to the desired indent position. 4) I start typing and TM2 immediately resets the indent position again. 5) User is vexed.
It seems like indent should peek the history stack. Certain immediately preceding sequences (e.g. user selecting an indent position) should temporarily disable auto-indent until more text insertion events occur.
-- John
On 12/01/2012, at 05.35, John Whitley wrote:
[…] It seems like indent should peek the history stack. Certain immediately preceding sequences (e.g. user selecting an indent position) should temporarily disable auto-indent until more text insertion events occur.
Presumably yes, TM can have the indent behavior improved by being better at understanding user intent; exactly how to go about that though is left as a future challenge.
For now there is just the boolean enable/disable.