[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode dece7f242e 160/212: Added more failing indent
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode dece7f242e 160/212: Added more failing indentation tests |
Date: |
Wed, 26 Jan 2022 01:51:19 -0500 (EST) |
branch: externals/phps-mode
commit dece7f242e6a6aafbba50a43739f8d8db19a1fe7
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added more failing indentation tests
---
phps-mode-indent.el | 17 +++++++++++++++--
test/phps-mode-test-indent.el | 4 ++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/phps-mode-indent.el b/phps-mode-indent.el
index b3d4c378b1..36ba5ee371 100644
--- a/phps-mode-indent.el
+++ b/phps-mode-indent.el
@@ -249,6 +249,7 @@
;; (message "current-line-starts-with-closing-bracket: %S"
current-line-starts-with-closing-bracket)
;; (message "current-line-starts-with-opening-bracket: %S"
current-line-starts-with-opening-bracket)
+ ;; (message "previous-line-ends-with-closing-bracket: %S"
previous-line-ends-with-closing-bracket)
;; (message "previous-line-ends-with-opening-bracket: %S"
previous-line-ends-with-opening-bracket)
;; (message "previous-line-ends-with-terminus: %S"
previous-line-ends-with-terminus)
;; (message "previous-bracket-level: %S" previous-bracket-level)
@@ -259,6 +260,17 @@
(cond
+ ;; // die(
+ ;; echo 'here';
+ ((string-match-p
+ "^[\t ]*//"
+ previous-line-string)
+ (when current-line-starts-with-closing-bracket
+ (setq
+ new-indentation
+ (- new-indentation tab-width))
+ ))
+
;; class MyClass implements
;; myInterface
;; or
@@ -967,10 +979,11 @@
(and
not-found-command-start
(search-backward-regexp
- "\\(;\\|}\\|{\\|[\t ]*[^\t ]+[\t ]*$\\)"
+ "\\(;\\|}\\|{\\|^[\t ]*[^\t\n ]+[\t ]*$\\)"
nil
t))
- (let ((match (match-string-no-properties 0)))
+ (let ((match (match-string-no-properties 1)))
+ ;; (message "match: %S" match)
(cond
;; End of expression / statement
diff --git a/test/phps-mode-test-indent.el b/test/phps-mode-test-indent.el
index a3e3423504..6b1553b561 100644
--- a/test/phps-mode-test-indent.el
+++ b/test/phps-mode-test-indent.el
@@ -188,6 +188,10 @@
"<?php\n$options = myFunction(\n array(array(\n 'options' =>
123\n ))\n);"
"Assignment with double-dimensional array with double arrow assignment
inside function call")
+ (phps-mode-test-indent--should-equal
+ "<?php\n// die('debug: ' . $debug\nif ($debug) {\n \n}\n"
+ "Line after commented out opening bracket line")
+
(phps-mode-test-indent--should-equal
"<?php\nswitch ($condition) {\n case 34:\n if ($item['Random'] %
10 == 0) {\n $attributes['item'] = ($item['IntegerValue'] / 10);\n
} else {\n $attributes['item'] =\n
number_format(($item['IntegerValue'] / 10), 1, '.', '');\n }\n
break;\n}\n"
"Switch case with conditional modulo expression")
- [elpa] externals/phps-mode 16ce2acfb7 077/212: Removed debug output for bookkeeping, (continued)
- [elpa] externals/phps-mode 16ce2acfb7 077/212: Removed debug output for bookkeeping, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode bc5039e32f 086/212: Created custom determine string indentation function, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode daff4ad5e0 085/212: More work on indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode b82475c697 090/212: Passed token-blind indentation for multi-line class extends and implements, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2ea2360c3e 091/212: Created indent helper functions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode df91b8e433 117/212: More handling of string-doc indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 6fac0d5585 102/212: Passed indent test for heredoc string, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 1af63142f3 127/212: Fixed incremental issue with new SDT based bookkeeping, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3565c7efb3 125/212: Fixed byte-compilation warnings for indent file, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a8097b5b5e 147/212: Improved indentation on line after equal operator in if condition list, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode dece7f242e 160/212: Added more failing indentation tests,
Christian Johansson <=
- [elpa] externals/phps-mode a530988fe0 134/212: Added more failing indent tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 8c1f529f87 145/212: Passing indent for line after ending of statement / expression with trailing closing bracket, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d7aa22d251 146/212: Added two new failing tests for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c453932f32 139/212: Added TODO item, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 8374026917 166/212: Improved indentation on lines starting with a closing square bracket, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2afb7dc87a 002/212: Generating basic imenu-index via parser SDT, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 41b1566c40 010/212: Imenu generation via parser SDT passing more tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 8f9870fb9b 013/212: Parser SDT does not use global variables, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 4753734b0a 006/212: Moved syntax coloring to separate file, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d037aa09bc 023/212: Added bookkeeping via parser SDT foreach ($x as $y) {}, Christian Johansson, 2022/01/26