[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode cc77604 284/405: Fixed bug with indentation a
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode cc77604 284/405: Fixed bug with indentation after switch case statements |
Date: |
Sat, 13 Jul 2019 10:00:33 -0400 (EDT) |
branch: externals/phps-mode
commit cc77604ee10b46f827a563d6d00c65accc6d420c
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Fixed bug with indentation after switch case statements
---
phps-mode-functions.el | 15 ++++++++++++++-
phps-mode-test-functions.el | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index 72be62d..9e31d71 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -305,6 +305,7 @@
(message "Ended switch curly stack at %s"
curly-bracket-level))
(setq allow-custom-column-decrement t)
+ (pop nesting-stack)
(setq alternative-control-structure-level (1-
alternative-control-structure-level))
(pop switch-curly-stack))
@@ -329,6 +330,7 @@
(pop switch-alternative-stack)
(pop switch-case-alternative-stack)
(setq allow-custom-column-decrement t)
+ (pop nesting-stack)
(setq alternative-control-structure-level (1-
alternative-control-structure-level)))
(when first-token-on-line
@@ -473,6 +475,9 @@
(push alternative-control-structure-level
switch-case-alternative-stack)))
(when token
+
+ (when phps-mode-functions-verbose
+ (message "Processing token: %s" token))
;; Calculate nesting
(setq nesting-end (+ round-bracket-level square-bracket-level
curly-bracket-level alternative-control-structure-level in-assignment-level
in-class-declaration-level concatenation-level))
@@ -500,20 +505,28 @@
;; Decrement column
(if allow-custom-column-decrement
(progn
+ (when phps-mode-functions-verbose
+ (message "Doing custom decrement 1 from %s to
%s" column-level (- column-level (- nesting-start nesting-end))))
(setq column-level (- column-level (-
nesting-start nesting-end)))
(setq allow-custom-column-decrement nil))
+ (when phps-mode-functions-verbose
+ (message "Doing regular decrement 1 from %s to %s"
column-level (1- column-level)))
(setq column-level (1- column-level)))
;; Prevent negative column-values
(when (< column-level 0)
(setq column-level 0)))
- (when (not temp-post-indent)
+ (unless temp-post-indent
+ (when phps-mode-functions-verbose
+ (message "Temporary setting post indent %s"
column-level))
(setq temp-post-indent column-level))
;; Decrement column
(if allow-custom-column-decrement
(progn
+ (when phps-mode-functions-verbose
+ (message "Doing custom decrement 2 from %s to
%s" column-level (- column-level (- nesting-start nesting-end))))
(setq temp-post-indent (- temp-post-indent (-
nesting-start nesting-end)))
(setq allow-custom-column-decrement nil))
(setq temp-post-indent (1- temp-post-indent)))
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 815ff60..cdee03d 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -632,7 +632,7 @@
(defun phps-mode-test-functions ()
"Run test for functions."
;; (setq debug-on-error t)
- (setq phps-mode-functions-verbose t)
+ ;; (setq phps-mode-functions-verbose t)
(phps-mode-test-functions-get-lines-lindent-if)
(phps-mode-test-functions-get-lines-indent-classes)
(phps-mode-test-functions-get-lines-indent-inline-if)
- [elpa] externals/phps-mode 5be3560 291/405: Adding more indent examples from PSR-2, (continued)
- [elpa] externals/phps-mode 5be3560 291/405: Adding more indent examples from PSR-2, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 74ab2a7 294/405: Work on incremental lexer and failing test for indent, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b31f817 292/405: Added all examples from PSR-2 as tests for indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2087abd 282/405: Added two failing tests for switch indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 43c13b4 295/405: Started on new algorithm for concatenation indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b2ff76e 283/405: Started on debugging switch indentation bug, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 1aadb1b 285/405: Added failing lexer test for comment vs doc-comment, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 95de04b 274/405: New layout for lexer grammar passes unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 00d3568 290/405: Added indentation examples from official PSR-2, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ec3fd41 289/405: Added failing indent test for mixed concatenation and function call, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode cc77604 284/405: Fixed bug with indentation after switch case statements,
Stefan Monnier <=
- [elpa] externals/phps-mode eeffdb2 315/405: Fixed trailing white-space, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 02b69f5 304/405: Tests for PSR-2 now passes with new algorithms, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b251a1e 314/405: Got unit tests for wrapping region in symbols working, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 20199b0 307/405: Added byte-compiled Lisp to gitignore, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a0b7695 316/405: Passes unit tests for integration with electric-pair, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7c3a31a 305/405: Fixed bug in indentation with stacked assignment closures, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 68422f5 301/405: Restored indentation test for PSR-2 closure, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f3766db 310/405: Fixed byte-compilation in lexer and integration-tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2ec6f6d 306/405: Fixed some compilation warnings, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f2fe751 302/405: More work on trying to get PSR-2 indentation working, Stefan Monnier, 2019/07/13