GNU bug report logs - #77901
tsx-ts-mode: ternary chains are indented as a tree

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Fri, 18 Apr 2025 14:26:06 UTC

Severity: normal

To reply to this bug, email your comments to 77901 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#77901; Package emacs. (Fri, 18 Apr 2025 14:26:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Konstantin Kharlamov <Hi-Angel <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 18 Apr 2025 14:26:08 GMT) Full text and rfc822 format available.

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

From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: tsx-ts-mode: ternary chains are indented as a tree
Date: Fri, 18 Apr 2025 17:06:34 +0300
Given this correctly indented code:

    const a = cond1 ? 1
      : cond2 ? 2
      : cond3 ? 3
      : 4;

if you reindent it, it turns into:

    const a = cond1 ? 1
      : cond2 ? 2
        : cond3 ? 3
          : 4;

Basically, for every colon it increases indentation. This is different
from other c-like languages (it's is indented as the first form
instead), and it's also different from Python. The "tree-indentation"
is not readable, so there's a reason other modes indent it as the
first example. Would it be possible to change in typescript mode as
well?




This bug report was last modified 5 days ago.

Previous Next


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