]> git.eshelyaron.com Git - emacs.git/commit
Indent arrows’ expression bodies like function bodies (Bug#25904)
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sat, 9 Feb 2019 20:26:21 +0000 (12:26 -0800)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 13 Feb 2019 00:23:50 +0000 (03:23 +0300)
commit21eef9fa7f5abc7587251a6671add780b7370bb7
tree22aca2523327daea120f1da4d518b72a5280a8c3
parentdd319f2711f895eec87c1017b82cd9d88d9ecd0a
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>
lisp/progmodes/js.el
test/manual/indent/js.js