aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJackson Ray Hamilton2019-02-09 12:26:21 -0800
committerDmitry Gutov2019-02-13 03:23:50 +0300
commit21eef9fa7f5abc7587251a6671add780b7370bb7 (patch)
tree22aca2523327daea120f1da4d518b72a5280a8c3 /test
parentdd319f2711f895eec87c1017b82cd9d88d9ecd0a (diff)
downloademacs-21eef9fa7f5abc7587251a6671add780b7370bb7.tar.gz
emacs-21eef9fa7f5abc7587251a6671add780b7370bb7.zip
Indent arrows’ expression bodies like function bodies (Bug#25904)
* lisp/progmodes/js.el (js--continued-expression-p): Don’t confuse ‘=>’ for a ‘>’ operator. (js--line-terminating-arrow-re): New variable. (js--looking-at-broken-arrow-function-p): New function. (js--proper-indentation): Don’t align arrow functions’ expression bodies starting on new lines like list continuations, instead align them like function bodies (js-indent-align-list-continuation need not be nil). * test/manual/indent/js.js: Add test for Bug#25904. Co-authored-by: Felipe Ochoa <felipe@fov.space>
Diffstat (limited to 'test')
-rw-r--r--test/manual/indent/js.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
index df790986947..647d7438f45 100644
--- a/test/manual/indent/js.js
+++ b/test/manual/indent/js.js
@@ -151,6 +151,15 @@ let b = {
151 ` 151 `
152} 152}
153 153
154// bug#25904
155foo.bar.baz(very => // A comment
156 very
157).biz(([baz={a: [123]}, boz]) =>
158 baz
159).snarf((snorf) => /* Another comment */
160 snorf
161);
162
154// Local Variables: 163// Local Variables:
155// indent-tabs-mode: nil 164// indent-tabs-mode: nil
156// js-indent-level: 2 165// js-indent-level: 2