[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode fc2e8b7 212/405: Added logic to indent token-
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode fc2e8b7 212/405: Added logic to indent token-less lines as well |
Date: |
Sat, 13 Jul 2019 10:00:15 -0400 (EDT) |
branch: externals/phps-mode
commit fc2e8b736d9ae77390986674cd3d9b3711d8a119
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Added logic to indent token-less lines as well
---
phps-mode-functions.el | 9 ++++++++-
phps-mode-test-functions.el | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index 64545f0..8f08c29 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -417,7 +417,14 @@
(puthash token-start-line-number `(,column-level-start
,tuning-level) line-indents))
- ;; TODO Fill token-less but in-scripting lines
in-between with indentation
+ ;; Indent token-less lines here in between last tokens
if distance is more than 1 line
+ (when (and (> next-token-start-line-number (1+
token-start-line-number))
+ (not (equal token 'T_CLOSE_TAG)))
+ (let ((token-line-number-diff (1- (-
token-start-line-number next-token-start-line-number))))
+ (while (>= token-line-number-diff 0)
+ (puthash (- token-start-line-number
token-line-number-diff) `(,column-level-start ,tuning-level) line-indents)
+ ;; (message "Saved line %s indent %s %s" (-
token-end-line-number token-line-number-diff) column-level tuning-level)
+ (setq token-line-number-diff (1-
token-line-number-diff)))))
;; Does token span over several lines?
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 9cf29e5..41e46be 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -542,8 +542,8 @@
(phps-mode-test-functions-get-lines-indent-inline-if)
(phps-mode-test-functions-get-lines-indent-alternative-if)
(phps-mode-test-functions-get-lines-indent-multi-line-assignments)
- (phps-mode-test-functions-get-lines-indent-switch-case)
(phps-mode-test-functions-get-lines-indent)
+ (phps-mode-test-functions-get-lines-indent-switch-case)
(phps-mode-test-functions-indent-line))
(phps-mode-test-functions)
- [elpa] externals/phps-mode ec69d07 193/405: Added a failing class declaration indentation case, (continued)
- [elpa] externals/phps-mode ec69d07 193/405: Added a failing class declaration indentation case, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 164b77e 205/405: Unit test for alternative control syntax passes with new algorithm, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e8658c8 192/405: New indentation algorithm now passes class unit tests, started on indentation document, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ba9d8a0 199/405: More organization of tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 86404c8 207/405: New algorithm now passes tests for alternative control structure, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8b4c188 188/405: Now able to detect indent change of scope with same nesting level, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 91715f6 217/405: Added another test for multi-line function arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 75c4af4 214/405: Fixed indentation for lines wrapped in scripting open/close, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d754163 221/405: More work on multi-line token-less lines, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8947e6e 202/405: Conceptual work on indentation-calculation for multi-line assignment, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode fc2e8b7 212/405: Added logic to indent token-less lines as well,
Stefan Monnier <=
- [elpa] externals/phps-mode 8707777 237/405: Updated README, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2d4646f 203/405: Work on inline control structure indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 202827b 198/405: New indentation algorithm now supports inline control structures, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b2a5700 218/405: Fixed indentation for multi-line optional function arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f7186a1 239/405: Preparations for hierarchical imenu, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 43bf350 216/405: Added tests for token-less lines, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0de10fa 235/405: Passes first test for imenu, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f791cee 234/405: Started on unit tests for imenu-index generation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b56a15c 233/405: Removed debugging output, updated todo items, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 73784d0 225/405: Cleaned up tests for indentation, Stefan Monnier, 2019/07/13