[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 5f445cd 229/405: Fixed indentation for while
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 5f445cd 229/405: Fixed indentation for while expressions |
Date: |
Sat, 13 Jul 2019 10:00:18 -0400 (EDT) |
branch: externals/phps-mode
commit 5f445cd0d66fb75e2d8e8aa21625e021d30ab70d
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Fixed indentation for while expressions
---
phps-mode-functions.el | 10 ++++++----
phps-mode-test-functions.el | 5 +++++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index b98aaa9..8e14b43 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -267,11 +267,13 @@
(when after-special-control-structure-first-on-line
(setq first-token-is-nesting-increase t)))
- (when phps-mode-functions-verbose
- (message "\nStarted inline control-structure after
%s at %s\n" after-special-control-structure-token token))
+ ;; Don't start inline control structures after a while
($condition); expression
+ (when (not (string= token ";"))
+ (when phps-mode-functions-verbose
+ (message "\nStarted inline control-structure after
%s at %s\n" after-special-control-structure-token token))
- (setq in-inline-control-structure t)
- (setq temp-pre-indent (1+ column-level))))
+ (setq in-inline-control-structure t)
+ (setq temp-pre-indent (1+ column-level)))))
(setq after-special-control-structure nil)
(setq after-special-control-structure-token nil)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index d284e7e..47da2bc 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -159,6 +159,11 @@
;; (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)))))
+ (phps-mode-test-with-buffer
+ "<?php\ndo {\n echo 'true';\n} while ($number > 0\n && $letter >
0\n);"
+ "Do while loop with multi-line condition"
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (0 0)) (5 (1 0)) (6 (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 00c0ab9 194/405: Nesting-stack algorithm handles class declaration indents, (continued)
- [elpa] externals/phps-mode 00c0ab9 194/405: Nesting-stack algorithm handles class declaration indents, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8a76039 189/405: Started implementing nesting-stack, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode cf7dc07 210/405: Preparations for multi-line quoted indentation tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 208a788 208/405: Re-organized indent tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c678fc1 209/405: New algorithm handles HEREDOC indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b6cf3a4 191/405: Started on new algorithm for indentation calculation based on stack, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b2338cd 223/405: All tests for indentation passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7a4b98e 215/405: More work on algorithm description, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9031c3a 211/405: Merge branch 'master' of https://github.com/cjohansson/emacs-phps-mode, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6105e5d 226/405: Added a new failing test for indetation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 5f445cd 229/405: Fixed indentation for while expressions,
Stefan Monnier <=
- [elpa] externals/phps-mode eb0ee5e 236/405: Updated README with imenu-support, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 811c499 220/405: New algorithm now works for switch, case syntax, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d2e5a03 228/405: Updated indentation algorithm document and README, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 1aa0f90 238/405: Typo in README, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode da1cfd5 231/405: Adding failing lexer test, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e6a8944 241/405: Started work on a lexer bug with expressions inside double quoted strings, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0c49d6d 243/405: Removed debugging output, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 95ac15a 245/405: Imenu index now handles class extends and implements, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 67233ef 213/405: Fixed indent algorithm for multi-line strings, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 36a4b64 222/405: Added lost test for token-less lines again, Stefan Monnier, 2019/07/13