[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2a79649 33/49: Fix indentation after regexp in js2-old-ind
From: |
Dmitry Gutov |
Subject: |
[elpa] master 2a79649 33/49: Fix indentation after regexp in js2-old-indent.el |
Date: |
Mon, 16 Jan 2017 15:35:49 +0000 (UTC) |
branch: master
commit 2a796499afd95a5b9f0eb2fb338102e917f30c93
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Fix indentation after regexp in js2-old-indent.el
Closes #382.
---
js2-old-indent.el | 4 ++++
tests/indent.el | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/js2-old-indent.el b/js2-old-indent.el
index f336005..1ecdba5 100644
--- a/js2-old-indent.el
+++ b/js2-old-indent.el
@@ -224,6 +224,10 @@ and comments have been removed."
(and (js2-re-search-backward "[?:{]\\|\\_<case\\_>" nil t)
(eq (char-after) ??))))
(not (and
+ (eq (char-after) ?/)
+ (save-excursion
+ (eq (nth 3 (syntax-ppss)) ?/))))
+ (not (and
(eq (char-after) ?*)
;; Generator method (possibly using computed property).
(looking-at (concat "\\* *\\(?:\\[\\|"
diff --git a/tests/indent.el b/tests/indent.el
index 0fabe95..0924691 100644
--- a/tests/indent.el
+++ b/tests/indent.el
@@ -194,6 +194,10 @@
| 5
|]")
+(js2-deftest-indent no-continued-expression-after-regexp
+ "var re = /some value/
+ |str.match(re)")
+
(js2-deftest-indent jsx-one-line
"var foo = <div></div>;")
- [elpa] master e45206b 11/49: js2-parse-class: Convert positions to relative for NAME and EXTENDS, too, (continued)
- [elpa] master e45206b 11/49: js2-parse-class: Convert positions to relative for NAME and EXTENDS, too, Dmitry Gutov, 2017/01/16
- [elpa] master bea6942 13/49: Unbind js2-mode-show-node, Dmitry Gutov, 2017/01/16
- [elpa] master c0801b2 12/49: Propertize regexp literals like js-mode does, Dmitry Gutov, 2017/01/16
- [elpa] master 9a8aaa9 28/49: Fix length of name in namespace-import nodes, Dmitry Gutov, 2017/01/16
- [elpa] master 44c289f 24/49: Copy edits, Dmitry Gutov, 2017/01/16
- [elpa] master b6d9301 17/49: Merge pull request #377 from XeCycle/memfn-delete, Dmitry Gutov, 2017/01/16
- [elpa] master 64ec0a2 14/49: Allow newline in globals declaration, Dmitry Gutov, 2017/01/16
- [elpa] master 2801681 26/49: Fix "pos" argument in template node constructors, Dmitry Gutov, 2017/01/16
- [elpa] master 712dfb0 29/49: Merge pull request #384 from mishoo/master, Dmitry Gutov, 2017/01/16
- [elpa] master df06798 23/49: Merge pull request #378 from JulianKniephoff/include-externs-locally, Dmitry Gutov, 2017/01/16
- [elpa] master 2a79649 33/49: Fix indentation after regexp in js2-old-indent.el,
Dmitry Gutov <=
- [elpa] master f450de0 34/49: Handle destructuring assignments when classifying variables, Dmitry Gutov, 2017/01/16
- [elpa] master 90e37cd 45/49: Merge pull request #397 from lelit/issue393, Dmitry Gutov, 2017/01/16
- [elpa] master 9b63a13 16/49: Special methods should allow keywords as names, Dmitry Gutov, 2017/01/16
- [elpa] master 672e2da 07/49: js2-parse-mul-expr: Parse the right operand as exponentiation too, Dmitry Gutov, 2017/01/16
- [elpa] master a91e357 40/49: Create a separate scope for switch statements, Dmitry Gutov, 2017/01/16
- [elpa] master 4d35da5 30/49: Fix the fix (error detection), Dmitry Gutov, 2017/01/16
- [elpa] master 31a2399 44/49: Mostly cosmetic, split js2--classify-variables in three simpler functions, Dmitry Gutov, 2017/01/16
- [elpa] master 3725fcf 35/49: Handle other cases of destructuring assignments/initializations, Dmitry Gutov, 2017/01/16
- [elpa] master dad7d09 32/49: feat: add js2-comments-between func, Dmitry Gutov, 2017/01/16
- [elpa] master 523b3cb 38/49: Add a STRICT parameter to js2--collect-declared-symbols, Dmitry Gutov, 2017/01/16