Search code examples
eclipsecudaeclipse-cdtcode-formattingautoformatting

Eclipse/nsight formatter doesn't respect function body indentation policy


I use CUDA 8.0's version of nsight (Eclipse platform 4.4.0, CDT 8.4.0). My Eclipse C/++ formatter is configured to indent as follows (image is from the Formatter config prev:

enter image description here

but if I have this code:

enter image description here

and I press enter, get to the next line (the cursor is placed under the span), and type in an opening brace, it is not placed at the beginning of the line, but is rather kept indented:

enter image description here

Is this a bug or have I misconfigured something?

Notes:

  • I tried both the built-in formatter and the "CUDA C" formatter; they behave the same in this case

Solution

  • I see this behaviour in stock CDT as well. It looks like a bug. Please file a bug report.