Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion haskell-indentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,11 @@ For example
(when (string= current-token "instance")
(haskell-indentation-read-next-token))
(haskell-indentation-type)
(cond ((string= current-token "=")
(cond ((eq current-token 'end-tokens)
(when (member following-token '("=" "where"))
(haskell-indentation-add-indentation current-indent)
(throw 'parse-end nil)))
((string= current-token "=")
(haskell-indentation-separated
#'haskell-indentation-expression "|" "deriving"))
((string= current-token "where")
Expand Down
6 changes: 6 additions & 0 deletions tests/haskell-indentation-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ data X = X
(2 0 2)
(3 0))

(hindent-test "13b honour = on a separate line in data declaration" "
data X a b
= X"
(1 0)
(2 2))

(hindent-test "14* Line starting with operator inside \"do\" needs to be indented""
fun = do
pure X
Expand Down