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

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

[elpa] externals/phps-mode 502a42b5c0 205/212: Improved indentation arou


From: Christian Johansson
Subject: [elpa] externals/phps-mode 502a42b5c0 205/212: Improved indentation around doc-comments
Date: Wed, 26 Jan 2022 01:51:27 -0500 (EST)

branch: externals/phps-mode
commit 502a42b5c0cd59d6913f06fb6e0bd4bfcd4822fe
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Improved indentation around doc-comments
---
 phps-mode-indent.el | 63 +++++++++++++++++++++++++++++++++--------------------
 1 file changed, 39 insertions(+), 24 deletions(-)

diff --git a/phps-mode-indent.el b/phps-mode-indent.el
index cf1387940f..a00d7b65d9 100644
--- a/phps-mode-indent.el
+++ b/phps-mode-indent.el
@@ -1078,6 +1078,45 @@
                  new-indentation
                  (- new-indentation tab-width)))
 
+               ;; LINE AFTER STARTING DOC-COMMENT
+               ;; /**
+               ;;  *
+               ((= previous-bracket-level 1)
+                (setq
+                 match-type
+                 'line-after-opening-doc-comment)
+                (setq
+                 new-indentation
+                 (+ new-indentation 1)))
+
+               ;; LINE AFTER ENDING OF DOC-COMMENT
+               ;; /**
+               ;;  *
+               ;;  */
+               ;; echo 'here';
+               ((= previous-bracket-level -1)
+                (setq
+                 match-type
+                 'line-after-ending-of-doc-comment)
+                (setq
+                 new-indentation
+                 (1- new-indentation)))
+
+               ;; LINE AFTER CONTINUATION OF DOC-COMMENT
+               ;; /**
+               ;;  * here
+               ;;  * there
+               ((and
+                 (string-match-p
+                  "^[\t ]*\\*"
+                  previous-line-string)
+                 (string-match-p
+                  "^[\t ]*/?\\*"
+                  previous2-line-string))
+                (setq
+                 match-type
+                 'line-after-continuation-of-doc-comment))
+
                ;; LINE AFTER LINE ENDING WITH COMMA
                ;; return array(
                ;;     '' => __(
@@ -1220,30 +1259,6 @@
                  new-indentation
                  (+ new-indentation tab-width)))
 
-               ;; LINE AFTER ENDING OF DOC-COMMENT
-               ;; /**
-               ;;  *
-               ;;  */
-               ;; echo 'here';
-               ((= previous-bracket-level -1)
-                (setq
-                 match-type
-                 'line-after-ending-of-doc-comment)
-                (setq
-                 new-indentation
-                 (1- new-indentation)))
-
-               ;; LINE AFTER STARTING DOC-COMMENT
-               ;; /**
-               ;;  *
-               ((= previous-bracket-level 1)
-                (setq
-                 match-type
-                 'line-after-opening-doc-comment)
-                (setq
-                 new-indentation
-                 (+ new-indentation 1)))
-
                ;; LINE AFTER LINE THAT ENDS AND STARTS A BRACKET BLOCK
                ;; ) {
                ;;     echo 'here'



reply via email to

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