bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8576: 23.2; js-mode doesn't support multi-line variable declarations


From: Dmitry Gutov
Subject: bug#8576: 23.2; js-mode doesn't support multi-line variable declarations
Date: Tue, 17 Jul 2012 08:21:27 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

"Felix H. Dahlke" <fhd@ubercode.de> writes:

> I tried some things but couldn't really make it work like I wanted.
> So I decided to just improve the patch a bit. I am now using the
> proper indentation which also fixes the issue reported by jaseemabid.

Yes, that's a bit better than my fix.

You shouldn't add the `js--indent-operator-re' constant, though, it's
already present in js-mode.

> The only solution I can think of would be to go back up after typing a
> closing brace followed by a comma and indent the preceeding lines.
> Some modes do that, but it would require drastic changes to js.el.
> I'd rather get this patch in first and see if the issue annoys me (or
> anyone else) enough to work further on this.

I don't think this will be much of a problem.

There is an alternative approach, though: one js2-mode user requested
that when the first value in the declaration is a function/object/array,
it should always be indented: https://github.com/mooz/js2-mode/issues/3

That option probably won't be very popular.

--Dmitry





reply via email to

[Prev in Thread] Current Thread [Next in Thread]