#815676 Bad indent after line with ternary operator in Qtcreator

Package:
qtcreator
Source:
qtcreator
Description:
integrated development environment (IDE) for Qt
Submitter:
Strelok
Date:
2026-08-20 17:37:02 UTC
Severity:
normal
Tags:
#815676#5
Date:
2016-02-23 16:14:26 UTC
From:
To:
I'm type a line "return x>0?array[0]:0;" and press enter. After this
indent in new line grow to 4 space. If line don't contain "[0]", bug
not appear.
Expected result: indent of new line must be the same as indent in
prevision line.
PS Also tested in qtcreator 3.6.0 (Debian Testing), result the same.

#815676#10
Date:
2016-02-23 19:20:47 UTC
From:
To:

Confirmed. Another work around is to use parenthesis,

  return (x > 0 ? array[0] : 0);

Thank you for your report.

- Adam