Skip to content

Commit de3eae4

Browse files
committed
Merge pull request #837 from rietmann/master
Fixed `haskell-indentation-newline-and-indent`
2 parents 0d3569d + 53da28e commit de3eae4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

haskell-indentation.el

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,19 @@ negative ARG. Handles bird style literate Haskell too."
254254
(defun haskell-indentation-newline-and-indent ()
255255
"Insert newline and indent."
256256
(interactive)
257-
(delete-horizontal-space)
258-
(newline)
259-
(unless (haskell-indentation-bird-outside-code-p)
257+
;; On RET (or C-j), we:
258+
;; - just jump to the next line if literate haskell, but outside code
259+
(if (haskell-indentation-bird-outside-code-p)
260+
(progn
261+
(delete-horizontal-space)
262+
(newline))
260263
(catch 'parse-error
264+
;; - save the current column
261265
(let* ((ci (haskell-indentation-current-indentation))
262266
(indentations (haskell-indentation-find-indentations-safe)))
267+
;; - jump to the next line and reindent to at the least same level
268+
(delete-horizontal-space)
269+
(newline)
263270
(when (haskell-indentation-bird-p)
264271
(insert "> "))
265272
(haskell-indentation-reindent-to

0 commit comments

Comments
 (0)