diff options
author | Jackson Ray Hamilton <jackson@jacksonrayhamilton.com> | 2019-02-09 12:26:21 -0800 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2019-02-13 03:23:50 +0300 |
commit | 21eef9fa7f5abc7587251a6671add780b7370bb7 (patch) | |
tree | 22aca2523327daea120f1da4d518b72a5280a8c3 /test/manual/indent | |
parent | dd319f2711f895eec87c1017b82cd9d88d9ecd0a (diff) | |
download | emacs-21eef9fa7f5abc7587251a6671add780b7370bb7.tar.gz |
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/manual/indent')
-rw-r--r-- | test/manual/indent/js.js | 9 |
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 = { ` } +// bug#25904 +foo.bar.baz(very => // A comment + very +).biz(([baz={a: [123]}, boz]) => + baz +).snarf((snorf) => /* Another comment */ + snorf +); + // Local Variables: // indent-tabs-mode: nil // js-indent-level: 2 |