all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jakub Jankiewicz <jcubic@onet.pl>
To: 15582@debbugs.gnu.org
Subject: bug#15582: js-mode indent bug
Date: Thu, 10 Oct 2013 14:06:48 +0200	[thread overview]
Message-ID: <20131010140648.2d3d1c4a@jcubic> (raw)

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

             reply	other threads:[~2013-10-10 12:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 12:06 Jakub Jankiewicz [this message]
2017-01-10  5:03 ` bug#15582: notes on js-mode indentation bug Tom Tromey
2017-01-14  3:51   ` Dmitry Gutov
2017-01-16 16:11     ` Tom Tromey
2017-01-14 17:45 ` bug#15582: done Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131010140648.2d3d1c4a@jcubic \
    --to=jcubic@onet.pl \
    --cc=15582@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.