[TxMt] TM2 - indentation problem in Haskell

Noah Daniels ndaniels at mac.com
Fri Jan 6 19:06:03 UTC 2012


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])



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20120106/be281d88/attachment-0001.html>


More information about the textmate mailing list