GNU bug report logs - #15582
js-mode indent bug

Previous Next

Package: emacs;

Reported by: Jakub Jankiewicz <jcubic <at> onet.pl>

Date: Thu, 10 Oct 2013 12:39:01 UTC

Severity: minor

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Jankiewicz <jcubic <at> onet.pl>
To: bug-gnu-emacs <at> gnu.org
Subject: js-mode indent bug
Date: Thu, 10 Oct 2013 14:06:48 +0200
[Message part 1 (text/plain, inline)]
Hi,

I found this bug in js-mode indent:

when you have multiline if statement with comment at the end, next line
indent is doubled.

If I have js-indent-level equal 8 the code look like this:

            if (x > left && x < left + image.width &&
                y > top && y < top + image.height) {
                    do_somethig();
            }

but when I put comment after if it look like this:

            if (x > left && x < left + image.width &&
                y > top && y < top + image.height) {  // found
                            do_somethig();


when js-indent-level is 2 it have 4 spaces. The same is with while

          while (10 &&
                 20) { // asd
              xx();

four spaces instead of two

version: GNU Emacs 24.2.1


--
Jakub Jankiewicz, Web Developer
http://jcubic.pl
[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 8 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.