Bug 544451 - Improper indentation after wrapped ternary expressions.
Summary: Improper indentation after wrapped ternary expressions.
Status: CLOSED DUPLICATE of bug 65463
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.8   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-14 15:55 EST by Curtis Smith CLA
Modified: 2019-02-17 10:41 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Smith CLA 2019-02-14 15:55:21 EST
The formatter improperly indents after a wrapped ternary expression. It indents all following statements with the indentation of the wrapped expression. My default indentation is set to indent one not two. There does not appear to be an option in the formatter to control anything with regard to ternary expressions.

Example:

        offset = length + Integer.SIZE + bytes.length > offset ?
            ( int ) pFile.length() : length;

            ByteBuffer header = ByteBuffer.allocate( length );
            header.putLong( i );
            header.putInt( offset );

            pFile.seek( offset );
            pFile.writeInt( bytes.length );
            pFile.write( bytes );
            pFile.seek( 0 );
            pFile.write( header.array() );
            pFile.setLength( offset + Integer.SIZE + bytes.length );
Comment 1 Dani Megert CLA 2019-02-15 05:56:01 EST
Are you using the formatter or 'Correct Indentation' (Ctrl+I)?

If the latter, it's bug 65463.
Comment 2 Curtis Smith CLA 2019-02-15 23:52:32 EST
It is just formatting automatically as I type. I am not invoking the formatter or the indentation correcter explicitly. The only way to prevent the problem is to disable the auto formatting so that it doesn't change it back.
Comment 3 Dani Megert CLA 2019-02-17 10:41:45 EST

*** This bug has been marked as a duplicate of bug 65463 ***