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

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

[elpa] externals/phps-mode 6a49784b8b 161/212: When indentation search p


From: Christian Johansson
Subject: [elpa] externals/phps-mode 6a49784b8b 161/212: When indentation search previous code lines it skips commented out lines
Date: Wed, 26 Jan 2022 01:51:19 -0500 (EST)

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

    When indentation search previous code lines it skips commented out lines
---
 phps-mode-indent.el | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/phps-mode-indent.el b/phps-mode-indent.el
index 36ba5ee371..7c298cf3dd 100644
--- a/phps-mode-indent.el
+++ b/phps-mode-indent.el
@@ -157,6 +157,7 @@
 
           ;; Try to find previous 2 non-empty lines
           (let ((line-is-empty-p t)
+                (line-is-comment-p t)
                 (searching-previous-lines 2))
             (while (and
                     (= (forward-line -1) 0)
@@ -171,7 +172,14 @@
                  (string-match-p
                   "^[ \t\f\r\n]*$"
                   line-string))
-                (unless line-is-empty-p
+                (setq
+                 line-is-comment-p
+                 (string-match-p
+                 "^[\t ]*\\(//\\|#\\)"
+                 line-string))
+                (unless (or
+                         line-is-empty-p
+                         line-is-comment-p)
                   (cond
                    ((= searching-previous-lines 2)
                     (setq
@@ -260,17 +268,6 @@
 
               (cond
 
-               ;; // die(
-               ;; echo 'here';
-               ((string-match-p
-                 "^[\t ]*//"
-                 previous-line-string)
-                (when current-line-starts-with-closing-bracket
-                  (setq
-                   new-indentation
-                   (- new-indentation tab-width))
-                  ))
-
                ;; class MyClass implements
                ;;     myInterface
                ;; or



reply via email to

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