litxio / ptghci

High-powered REPL for Haskell, inspired by IPython
Other
336 stars 6 forks source link

issue with auto-indentation; function with guards #9

Open aaarbk opened 5 years ago

aaarbk commented 5 years ago

First off, I think this is a fantastic effort and a massive improvement over the regular repl!

I've noticed a possible issue with the auto-indentation. (I say "possible" because I'm not an experienced Haskell programmer so maybe there's a good reason behind the current behaviour.)

I'm trying to write a function that uses guards, for example:


f x
   | x > 0 = 1
   | x < 0 = -1
   | otherwise = 0

I press <Meta+Enter> after typing in the function signature, and then proceed to type in the first guard.. but the auto-indentation doesn't kick in at any point:

On the second guard, only after typing space after the pipe does the autoindent kick in; but obviously that doesn't help.

It works if I indent manually by pressing Tab before I type in the pipe for the first guard itself.