From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#23492: 24.5; JS spread operator breaks indentatiton Date: Tue, 10 May 2016 00:34:54 +0300 Message-ID: <2fcc97dc-e086-252f-59eb-9684e226b12f@yandex.ru> References: <4EB8157C-7955-4A17-A5A1-CDBA84D7B1C8@samdesota.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1462829790 30628 80.91.229.3 (9 May 2016 21:36:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 May 2016 21:36:30 +0000 (UTC) To: Sam DeSota , 23492@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 09 23:36:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1azsqg-0005NX-Gl for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 May 2016 23:36:18 +0200 Original-Received: from localhost ([::1]:43445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azsqc-0000zA-8c for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 May 2016 17:36:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azsqW-0000sy-EL for bug-gnu-emacs@gnu.org; Mon, 09 May 2016 17:36:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azsqQ-0003eK-7m for bug-gnu-emacs@gnu.org; Mon, 09 May 2016 17:36:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azsqQ-0003eA-4O for bug-gnu-emacs@gnu.org; Mon, 09 May 2016 17:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1azsqQ-0005Nj-0P for bug-gnu-emacs@gnu.org; Mon, 09 May 2016 17:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 May 2016 21:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23492 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23492-submit@debbugs.gnu.org id=B23492.146282970620617 (code B ref 23492); Mon, 09 May 2016 21:36:01 +0000 Original-Received: (at 23492) by debbugs.gnu.org; 9 May 2016 21:35:06 +0000 Original-Received: from localhost ([127.0.0.1]:44794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azspV-0005MT-Nk for submit@debbugs.gnu.org; Mon, 09 May 2016 17:35:05 -0400 Original-Received: from mail-wm0-f67.google.com ([74.125.82.67]:36044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azspT-0005Lv-9k for 23492@debbugs.gnu.org; Mon, 09 May 2016 17:35:04 -0400 Original-Received: by mail-wm0-f67.google.com with SMTP id w143so22524037wmw.3 for <23492@debbugs.gnu.org>; Mon, 09 May 2016 14:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=L02thXsDMPNt5W0Ajp53gzLe7PPbXUTvRDqTaPVFdz0=; b=jbUimWhrt/Lem9tnIoyfR9Ptq6ICn7gPaLns5pME6KXK6ow86uP/Z4GlabtAV7PUTb 80dw8YD7H3eH9rYleaMiPh7ljqAt3k9qwD/YBglKAZtIHoFmK2I6fMo8CL9HQFbKOjSB bvAmm98Jy4DqTkL1kMnEJR/eb45tFjHoYWNCgKm1ChLzaUUrnhOZGaqJejP8JdP4HUO8 g8MoBW1zSk64gfShZvN8C6ulXqdwz6L2oV5mjjpWACSbb5rE0+13a+vZI1vnF8v10tTc gRqhnwO4ii2vgzjwonw+TRgFOs1vw+98Pf3m943Q8kzA5R4uDXow3HpYtGCbOnIrKGsP cy0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:cc:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=L02thXsDMPNt5W0Ajp53gzLe7PPbXUTvRDqTaPVFdz0=; b=ZoWW25OMpUQTn7rvPBq4KWMEoinH2QdD9Xdjwk9PEVKHaIWbYGDraPrVMlB2JN0p1S xRO0b/PVwJmVYbreYRm5U05axNj04czZ+WBoWlgzjxUXB5QfefL5vfu+IGX+jZP7SqNX gk7gBrRIRrBMo4gzHnWWUSJ33SGX5Uqh9chZPV/jBfRJmgo348aFgDxAJoyiDG+o+hHs FcNh/SFUl3b7P+9aGCwI1zf/I4f2SciCqmJ7PVBVgQ7s474groMgHwO2yRz0HYH9wtDg f4zUjtILgOKxEVbWIVyxAbaj7sSUV+wzz7aE5r3v1CJCBFoH+YMG/imMrUDUSedz540L V4lQ== X-Gm-Message-State: AOPr4FXhX2be8MRnYRCiUnXzMEiQFlxAtEqvi55/PV1NZj3KOO5dCPvC3mcy/0t3m9uwPg== X-Received: by 10.28.154.2 with SMTP id c2mr13479005wme.9.1462829696918; Mon, 09 May 2016 14:34:56 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id k62sm13321701wmb.7.2016.05.09.14.34.55 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2016 14:34:56 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118042 Archived-At: On 05/09/2016 05:50 AM, Sam DeSota wrote: > > Using the ES spread operator at the begining of a line causes the > indentation level to go up, as if it were a chained property access. > > ``` > { > test: true, > ...spread // Indentation should be back one > } > ``` Thanks for the report. Eli, do you think this will be okay to fix in emacs-25? The patch is below: diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 48eb3e7..f024d39 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1744,7 +1744,7 @@ js--declaration-keyword-re "Regular expression matching variable declaration keywords.") (defconst js--indent-operator-re - (concat "[-+*/%<>&^|?:.]\\([^-+*/]\\|$\\)\\|!?=\\|" + (concat "[-+*/%<>&^|?:.]\\([^-+*/.]\\|$\\)\\|!?=\\|" (js--regexp-opt-symbol '("in" "instanceof"))) "Regexp matching operators that affect indentation of continued expressions.") diff --git a/test/indent/js.js b/test/indent/js.js index 23fae17..b40d47b 100644 --- a/test/indent/js.js +++ b/test/indent/js.js @@ -103,6 +103,12 @@ Foobar console.log(num); }); +var z = [ + ...iterableObj, + 4, + 5 +] + var arr = [ -1, 2, -3, 4 +