nilcons / hi2

haskell-indentation 2nd try
GNU General Public License v3.0
33 stars 3 forks source link

Multi-way if's indent still doesn't work correctly #12

Closed konn closed 10 years ago

konn commented 10 years ago

Thank you for supporting MultiWayIf! By the way, it cannot handle indentation correctly if the first guard starts at the same line as if. Suppose, in the below code: the cursor is placed right after the first | (indicated by ^) below:

main :: IO ()
main = if | True -> undefined
--                 ^ here
          | otherwise -> undefined

Then, if I hit C-j, hi2 place the undefined as follows:

main :: IO ()
main = if | True ->
  undefined
          | otherwise -> undefined

This behaviour is wrong, and GHC claims parse error. undefined should be placed on the right to |.

klao commented 10 years ago

Thank you! I didn't notice this issue while testing yesterday. Fixed.