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

Done: Yuan Fu <casouri <at> gmail.com>

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>,
 Yuan Fu <casouri <at> gmail.com>
Cc: 77901 <at> debbugs.gnu.org
Subject: Re: bug#77901: tsx-ts-mode: ternary chains are indented as a tree
Date: Sat, 10 May 2025 13:16:30 +0300
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Date: Thu, 01 May 2025 20:39:02 +0700
> 
> After poking around I wrote a patch (attached). Worth noting though, for
> some reason it doesn't work for ternary without starting colon, e.g.:
> 
>     const a = cond1 ? 1 :
>       cond2 ? 2 :
>       cond3 ? 3 : 4;
> 
> I'm unclear why, per my understanding the "standalone-parent" of the
> whole ternary chain (disregarding where the point is) is the `const a
> =` declaration.
> 
> Such bug also persists in c++-ts-mode (as opposed to non-ts plain c++-
> mode). I'm not sure if it's me misunderstanding something or not…

Yuan, any comments?




This bug report was last modified 11 days ago.

Previous Next


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