branch: elpa/haskell-tng-mode commit 444664d43893c677cffff09021ddd76b3663df5b Author: Tseen She <ts33n....@gmail.com> Commit: Tseen She <ts33n....@gmail.com>
special case indentation of visual line breaks --- haskell-tng-smie.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el index 37377b4..8f85057 100644 --- a/haskell-tng-smie.el +++ b/haskell-tng-smie.el @@ -51,10 +51,15 @@ When in a comment and called with a prefix, the comment will be completed." (delete-region (point) (line-end-position))) ;; TODO don't continue line comments if there is code before them ;; - ;; TODO in-comment indent should observe | haddock markers - (if alt - (call-interactively #'newline-and-indent) - (call-interactively #'comment-indent-new-line)) + ;; TODO in-comment indent should observer but not repeat | haddock markers + (cond + (alt + (call-interactively #'newline-and-indent)) + ((looking-back (rx (>= 3 "-")) (line-beginning-position)) + ;; don't continue or indent visual line breaks + (call-interactively #'newline)) + (t + (call-interactively #'comment-indent-new-line))) (when rem (save-excursion (insert rem)))))