Skip to content

Honor equals on its own line in data decl #1105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2016
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