emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode 444664d 257/385: special case indentation


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 444664d 257/385: special case indentation of visual line breaks
Date: Tue, 5 Oct 2021 23:59:42 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 444664d43893c677cffff09021ddd76b3663df5b
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@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)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]