[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode e249124 152/405: Prevent negative indent
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode e249124 152/405: Prevent negative indent |
Date: |
Sat, 13 Jul 2019 10:00:03 -0400 (EDT) |
branch: externals/phps-mode
commit e249124491c3c910c30a9ce61fcb369762cb5e80
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Prevent negative indent
---
phps-mode-functions.el | 3 ++-
phps-mode-test-functions.el | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index 290d643..fb3f594 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -87,7 +87,8 @@
(setq nesting-end (+ round-bracket-level
square-bracket-level curly-bracket-level alternative-control-structure-level
inline-control-structure-level))
;; Is line ending indentation lesser than line beginning
indentation?
- (when (< nesting-end nesting-start)
+ (when (and (< nesting-end nesting-start)
+ (> column-level 0))
;; Decrease indentation by one
(setq column-level (1- column-level)))
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index ab63e80..f41a0e6 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -69,9 +69,9 @@
(should (equal '((1 (0 0)) (2 (0 0)) (3 (0 1)) (4 (0 1)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
- "<?php\nmyFunction(\n array(\n 23,\n [\n 25\n
]\n )\n);"
+ "<?php\nmyFunction(array(\n 23,\n [\n 25\n ]\n)\n);"
"Round and square bracket expressions"
- (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (2 0)) (6 (3
0)) (7 (2 0)) (8 (1 0)) (9 (0 0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (2 0)) (6 (1
0)) (7 (0 0)) (8 (0 0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
;; TODO CASE, DEFAULT
- [elpa] externals/phps-mode 52c502c 139/405: Improved logic for doc-comment tracking, (continued)
- [elpa] externals/phps-mode 52c502c 139/405: Improved logic for doc-comment tracking, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 1472273 136/405: Begun working on new approach to indentation calculation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9792f70 133/405: Cleaning up code gather point meta information, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode cc947a9 140/405: Added more tests for new indentation function, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d3e00f2 141/405: Starting on new function for indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c68c7a0 131/405: Fixed issue were first-token-on-line was nil, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c4ee0c3 132/405: Added more failing tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0b3ced4 145/405: First test for new indentation function passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 96588b5 142/405: More work on new indentation calculation functions, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9d6af11 157/405: More work on indentations, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e249124 152/405: Prevent negative indent,
Stefan Monnier <=
- [elpa] externals/phps-mode 4a27c44 147/405: Added support for naming unit tests to better find failures, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b852f5f 160/405: All tests for indentation passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode dfb0427 151/405: Added unit test for round and square bracket expressions, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7b8cea3 163/405: Added failing indentation test for class multiple implements, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a61ff64 134/405: Renamed function get-point-data to get-current-line-data for better semantics, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b99da6b 153/405: Starting using new indentation calculation for indentations, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6559760 166/405: Work on assignments and class declaration indentations, Stefan Monnier, 2019/07/13
- [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