0

when I write code (Javascript, specifically) in a web-mode buffer which chains methods across newlines:

object.foo()
.bar()

web-mode seems to want to align it like this:

object.foo()
      .bar()// hitting enter here will dot-align my code

how can I get it to ignore alignment in this case and instead perform javascript-mode style indentation like this:

object.foo()
    .bar()// adding the closing paren here will indent code by four spaces

? web-mode-code-indent-offset is set to 4, which works in all other cases like functions and other blocks, but not here, and nothing else in M-x customize-group web-mode seemed immediately applicable.

I'm using Emacs 26.0 and web-mode 20170131.

thanks!

1

ah, turns out it's the web-mode-indentation-params list:

(add-to-list '(web-mode-indentation-params) '("lineup-calls" . nil))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.