[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode f1236e2 169/405: Unit tests for indentation c
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode f1236e2 169/405: Unit tests for indentation calculation for multi-line strings passes |
Date: |
Sat, 13 Jul 2019 10:00:06 -0400 (EDT) |
branch: externals/phps-mode
commit f1236e2f66eed7f52cdc0df91c974ee4fbc941ef
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Unit tests for indentation calculation for multi-line strings passes
---
phps-mode-functions.el | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index b314a4a..52a1240 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -128,7 +128,7 @@
(puthash last-line-number `(,column-level ,tuning-level)
line-indents))
(when (> token-end-line-number token-start-line-number)
- ;; (message "Token %s starts at %s and ends at %s" token
token-start-line-number token-end-line-number)
+ (message "Token %s starts at %s and ends at %s" token
token-start-line-number token-end-line-number)
(when (equal token 'T_DOC_COMMENT)
(setq tuning-level 1))
@@ -165,7 +165,17 @@
(setq first-token-is-nesting-decrease nil)
(setq in-assignment-level 0)
(setq in-class-declaration-level 0)))
- (setq first-token-on-line nil))
+ (setq first-token-on-line nil)
+ (when (> token-end-line-number token-start-line-number)
+ ;; (message "Token not first on line %s starts at %s and
ends at %s" token token-start-line-number token-end-line-number)
+ (when (equal token 'T_DOC_COMMENT)
+ (setq tuning-level 1))
+
+ (let ((token-line-number-diff (1- (- token-end-line-number
token-start-line-number))))
+ (while (>= token-line-number-diff 0)
+ (puthash (- token-end-line-number
token-line-number-diff) `(,column-level ,tuning-level) line-indents)
+ (setq token-line-number-diff (1-
token-line-number-diff))))
+ (setq tuning-level 0)))
;; Keep track of round bracket level
(when (string= token "(")
- [elpa] externals/phps-mode 2720be8 165/405: Indentation calculation for heredoc and nowdoc assignments passes, (continued)
- [elpa] externals/phps-mode 2720be8 165/405: Indentation calculation for heredoc and nowdoc assignments passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 13c4c78 164/405: More work on heredoc, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 47ffc37 179/405: More work on refactored indentation calculation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a5ced61 158/405: New indentation function passes all original unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e3eedd7 167/405: Assignment indentation passes tests, class declaration remains, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e37c1cf 150/405: New indention calculation works with doc-comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f789468 172/405: Took notes of new indentation tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 20e77aa 181/405: Removed debug output, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 321803a 182/405: Line indents are now cleaning on buffer changes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 38bcabb 176/405: Improved detection of assignment ends in function optional arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f1236e2 169/405: Unit tests for indentation calculation for multi-line strings passes,
Stefan Monnier <=
- [elpa] externals/phps-mode 105fece 149/405: New indent calculation for inline syntax passes test, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0a32b17 161/405: Improved calculation for indentation for multi-line assignments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b2eac4d 154/405: More work on switch case default, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6b5a5c3 155/405: More work on calculating indentations, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ce2d4bd 148/405: New indentation calculation function passes alternative, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3718931 156/405: Basic tests for indentation calculation passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 13e9148 159/405: Indentation unit test for assignment is passing, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b5c64c1 162/405: Added failing tests for HEREDOC and NOWDOC assignments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f283e4b 173/405: Added new failing unit tests for multiple-lines IF and single line class declaration, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 59474ea 180/405: Improved debugging messages, Stefan Monnier, 2019/07/13