[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 75c4af4 214/405: Fixed indentation for lines
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 75c4af4 214/405: Fixed indentation for lines wrapped in scripting open/close |
Date: |
Sat, 13 Jul 2019 10:00:15 -0400 (EDT) |
branch: externals/phps-mode
commit 75c4af4e60a5db38f7494f847bf03a726dbe38dd
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Fixed indentation for lines wrapped in scripting open/close
---
phps-mode-functions.el | 6 ++++--
phps-mode-test-functions.el | 6 ++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index 4340359..b208b65 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -510,8 +510,10 @@
(setq in-heredoc-started-this-line nil)
(setq special-control-structure-started-this-line
nil)))
- ;; Current token is not first
- (setq first-token-on-line nil)
+ ;; Current token is not first if it's not <?php or <?=
+ (when (not (or (equal token 'T_OPEN_TAG)
+ (equal token 'T_OPEN_TAG_WITH_ECHO)))
+ (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)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index cda2fad..e765760 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -117,6 +117,12 @@
;; (message "Tokens: %s" phps-mode-lexer-tokens)
(should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (1 0)) (5 (0 0)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+ (phps-mode-test-with-buffer
+ "<?php if (true) { ?>\n <?php echo 'here'; ?>\n<?php } ?>"
+ "Regular if-expression but inside scripting tags"
+ ;; (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (1 0)) (3 (0 0)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+
)
(defun phps-mode-test-functions-get-lines-indent-multi-line-assignments ()
- [elpa] externals/phps-mode e8a8d41 204/405: Merged remote changes, (continued)
- [elpa] externals/phps-mode e8a8d41 204/405: Merged remote changes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode faa4e00 201/405: Started on conceptually describing algorithm for multi-line assignment indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 874701d 195/405: Work on alternative and inline control structure syntax with new algorithm, Stefan Monnier, 2019/07/13
- [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 <=
- [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, 2019/07/13
- [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