From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61026: 29.0.60; c-ts-mode: Broken indentation for loops and conditions without brace Date: Wed, 25 Jan 2023 21:21:27 +0100 Message-ID: <87ilgu8iwo.fsf@thornhill.no> References: Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12136"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61026@debbugs.gnu.org, Yuan Fu To: Mohammed Sadiq Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 25 21:22:28 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKmHr-0002y7-Ul for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Jan 2023 21:22:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKmHZ-0004oE-9k; Wed, 25 Jan 2023 15:22:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKmHT-0004nZ-DG for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 15:22:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKmHS-0007x6-2Y for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 15:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pKmHR-0004hb-Kh for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 15:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jan 2023 20:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61026 X-GNU-PR-Package: emacs Original-Received: via spool by 61026-submit@debbugs.gnu.org id=B61026.167467809418040 (code B ref 61026); Wed, 25 Jan 2023 20:22:01 +0000 Original-Received: (at 61026) by debbugs.gnu.org; 25 Jan 2023 20:21:34 +0000 Original-Received: from localhost ([127.0.0.1]:60047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKmGz-0004gu-QA for submit@debbugs.gnu.org; Wed, 25 Jan 2023 15:21:34 -0500 Original-Received: from out-135.mta0.migadu.com ([91.218.175.135]:16209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKmGw-0004gh-6D for 61026@debbugs.gnu.org; Wed, 25 Jan 2023 15:21:31 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1674678088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PDZ1IkpBCQiFtIgNVsYzWU19mckqfZ+brNB4tLzRQic=; b=mJ9F38Bst4hyt9m3CYr8p8Jy9sDt+fjnFUmnOpeo32ZC0kGPmC6LQ9rfHMT2m8/ZoWtFWN ZIS031Zaza73nmHGBAE2i0syzO4yvVH4pCWkW1ngyLWKTkIbVojuomIEPpbTSTvVI2oesZ +FCnCXMn2q2Ty9x0O/ZuVe1BGO3vZEew7PfbZxfMnY6/etOeJsnfq/WPYeWH2Km5dJw9sN Z2WrdvgrAIJlY1z2eyZ2VAuMrPMs2W+8+ugJQqrHb7H5Vdb74lcKFw52JHOuNb+pUCC7Aa sXsBiQ82dtrx4L4g5BYFIszmpDwhsq8xBOlz2Z6PkN0Zb9kF+JwPZr818zj6ug== In-Reply-To: (Mohammed Sadiq's message of "Mon, 23 Jan 2023 16:47:38 +0530") X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254152 Archived-At: Mohammed Sadiq writes: > The following code has broken indentation with c-ts-mode: > > while (true) > if (true) { > puts ("Hello"); > } > > if (true) > if (true) > { > puts ("World"); > } > > For which, I expect to get the following indentation (with default config): > > while (true) > if (true) { > puts ("Hello"); > } > > if (true) > if (true) > { > puts ("World"); > } > > Thanks, Mohammed! Yuan, I'm not sure the new brace counting method is a good enough improvement just yet considering its complexity and the number of issues we are seeing. Do you see any simple fixes for these issues? I can try to debug this this weekend, but not sure I really have time to fix it. All of these issues work fine in js-ts-mode or java-ts-mode, if I'm not mistaken. Theo