[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 47440dd 036/405: Added test for decreasing in
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 47440dd 036/405: Added test for decreasing indentation with letters |
Date: |
Sat, 13 Jul 2019 09:59:35 -0400 (EDT) |
branch: externals/phps-mode
commit 47440ddc6c74a161c7de015bd3132e59a4b9d672
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Added test for decreasing indentation with letters
---
phps-functions.el | 3 ++-
phps-test-functions.el | 9 ++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/phps-functions.el b/phps-functions.el
index 1d26588..cc2bc7a 100644
--- a/phps-functions.el
+++ b/phps-functions.el
@@ -50,7 +50,8 @@
(let* ((indent-start (* (+ (nth 1 start) (nth 2 start)) 4))
(indent-end (* (+ (nth 1 end) (nth 2 end)) 4))
(indent-diff 0))
- (when (> indent-start indent-end)
+ (when (and (> indent-start indent-end)
+ (looking-at-p "^[][ \t)(}{};]+\\($\\|?>\\)"))
(setq indent-diff (- indent-start indent-end)))
(setq indent-level (- indent-start indent-diff))
(message "inside scripting, start: %s, end: %s, indenting to
column %s " start end indent-level)
diff --git a/phps-test-functions.el b/phps-test-functions.el
index f5f637f..3f6543e 100644
--- a/phps-test-functions.el
+++ b/phps-test-functions.el
@@ -81,13 +81,20 @@
(let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
(should (equal buffer-contents "<?php\n$variable = array(\n
'random'\n);\n$variable = true;\n"))))
-(phps-mode/with-test-buffer
+ (phps-mode/with-test-buffer
"<?php\n$variable = array(\n 'random'\n );\n$variable = true;\n"
(goto-char 39)
(phps-mode/indent-line)
(let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
(should (equal buffer-contents "<?php\n$variable = array(\n
'random'\n);\n$variable = true;\n"))))
+ (phps-mode/with-test-buffer
+ "<?php\n$variable = array(\n'random');\n$variable = true;\n"
+ (goto-char 29)
+ (phps-mode/indent-line)
+ (let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
+ (should (equal buffer-contents "<?php\n$variable = array(\n
'random');\n$variable = true;\n"))))
+
)
(defun phps-mod/test-functions ()
- [elpa] externals/phps-mode bf59f0a 023/405: More unit tests for getting point lex information, (continued)
- [elpa] externals/phps-mode bf59f0a 023/405: More unit tests for getting point lex information, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode de771b5 019/405: Added more unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e3a060a 026/405: Handles script breaking single-line comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7fa9fdb 024/405: More unit tests for lexing comments and doc comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 64a3ca8 014/405: Modified start and end for single and double quoted strings, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3ea8c64 003/405: Added license, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f6e3ce4 027/405: Added another test for comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 4fa9341 030/405: Started with unit tests for indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 184dfa5 034/405: Indentation outside PHP now does nothing, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 5c0568b 033/405: Added some basic unit tests for indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 47440dd 036/405: Added test for decreasing indentation with letters,
Stefan Monnier <=
- [elpa] externals/phps-mode 9d3f644 032/405: Separated indentation tests for lexer tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d839f8a 029/405: More work on indentation support, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode efcefde 035/405: Added support for closing parenthesis and braces, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 1b891ea 031/405: More work on indentation and related tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c6e5255 038/405: Merge branch 'master' of https://github.com/cjohansson/emacs-phps-mode, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3837d9c 001/405: My initial commit, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6776468 037/405: Started worked with adding references to tokens from point meta information, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode feb5724 039/405: Various debug work, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e36d477 045/405: token-number from point now is the same format as (nth), Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b437374 040/405: Fixed bug in parsing of object parameters inside double quoted string, Stefan Monnier, 2019/07/13