[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
- [elpa] externals/phps-mode 2432928a86 096/212: Indentation passing more tests for alternative control structures, (continued)
- [elpa] externals/phps-mode 2432928a86 096/212: Indentation passing more tests for alternative control structures, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode cef879268b 103/212: Added two new tests for failing indentation for multi-line concatenated strings, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 40ce934c11 116/212: Indent support for string-doc in assignment, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode fbe600500f 135/212: More work on array and argument element indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 6cb18913e4 152/212: Improved indentation for lines ending with closing bracket and comma, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 26d7b64086 144/212: Added TODO item for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 0e7eb04800 149/212: Passing indentation test for multiple function arguments with default values, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2e16122284 153/212: Improved indentation on line after closing bracket and comma, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 1825ee499b 151/212: More wrestling with indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 29fee20e43 141/212: Passed all tests for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 6a49784b8b 161/212: When indentation search previous code lines it skips commented out lines,
Christian Johansson <=
- [elpa] externals/phps-mode 5432a61340 162/212: Improved indentation around closing of multi-dimensional brackets, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 28a5302e08 148/212: Passing indentation on line after closing bracket and command and were current line starts with closing bracket, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode be61c94dc3 165/212: Added TODO item, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c65d433a73 138/212: Improved indentation around multi-line function-calls, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f537965850 168/212: Improved indentation on lines after lines that ends with semicolon, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 6d8544d7fa 171/212: Added two more failing tests for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 616e3dc7ea 172/212: Added a TODO file, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d74686e07c 180/212: Started on optimizing lexer, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 06b35e4bf1 183/212: Fixed TODO item in this branch, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 40ecf58372 189/212: Adjustments for indent helper function determining last index line, Christian Johansson, 2022/01/26