diff --git a/purescript-indentation.el b/purescript-indentation.el index ddfef9e..f972bff 100644 --- a/purescript-indentation.el +++ b/purescript-indentation.el @@ -762,9 +762,7 @@ indent the current line. This has to be fixed elsewhere." (throw 'parse-end nil))))) (defun purescript-indentation-layout (parser) - (if (string= current-token "{") - (purescript-indentation-list parser "}" ";" nil) - (purescript-indentation-implicit-layout-list parser))) + (purescript-indentation-implicit-layout-list parser)) (defun purescript-indentation-expression-token (token) (member token '("if" "let" "do" "case" "\\" "(" "[" "{" "::" diff --git a/tests/purescript-indentation-tests.el b/tests/purescript-indentation-tests.el index f2dac73..c3fd10f 100644 --- a/tests/purescript-indentation-tests.el +++ b/tests/purescript-indentation-tests.el @@ -237,3 +237,44 @@ foo = do identifier :: Array String <- function call _ <- another call pure unit")) + +(ert-deftest let-in-separate-lines () + "Tests bug #12" + (purescript-test-indentation " +test1 a += let { x } = a +in x" + +" +test1 a + = let { x } = a + in x")) + +(ert-deftest case-of-separate-lines () + "Tests bug #12" + (purescript-test-indentation " +test3 a += case a of +{ x: y } +-> y" + + " +test3 a + = case a of + { x: y } + -> y")) + +(ert-deftest comma-first-list-after-case-of () + "A comma-first list was getting misindented if goes after case-of" + :expected-result :failed + (purescript-test-indentation " +fun = case _ of + [ a + , b ] +" + +" +fun = case _ of + [ a + , b ] +"))