Bug 571839 - First line of block comment is incorrectly formatted even if formatting is turned off for block comments
Summary: First line of block comment is incorrectly formatted even if formatting is tu...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 10.1.0   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-10 05:43 EST by Jan Poganski CLA
Modified: 2021-03-10 05:44 EST (History)
2 users (show)

See Also:


Attachments
code style profile with disabled comment formatting (16.08 KB, image/png)
2021-03-10 05:43 EST, Jan Poganski CLA
no flags Details
original block comment (2.00 KB, image/png)
2021-03-10 05:44 EST, Jan Poganski CLA
no flags Details
altered block comment (1.99 KB, image/png)
2021-03-10 05:44 EST, Jan Poganski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Poganski CLA 2021-03-10 05:43:27 EST
Created attachment 285789 [details]
code style profile with disabled comment formatting

Overview:
Thanks to bug 540001 we can disable code formatting for comments. But indented block comments are changed anyways when comment formatting has been turned off.

Steps to Reproduce:
1. Click Windows > Preferences > C/C++ > Code Style > Code Formatter.
2. Create a new profile based on K&R [built-in].
3. Edit the profile so that comment formatting is disabled (see attachment codestyleprofile.png).
4. Confirm all dialogs to save and apply the new profile.
5. Create a new and empty C source file.
6. Insert an indented block comment.
7. Click Edit > Select All.
8. Click Source > Format.

Actual Result:
The first line of the block comment is no longer indented.
(see attachment beforecodeformatting.png)

Expected Results:
The entire comment is not touched by the code formatter at all.
(see attachment aftercodeformatting.png)
Comment 1 Jan Poganski CLA 2021-03-10 05:44:14 EST
Created attachment 285790 [details]
original block comment
Comment 2 Jan Poganski CLA 2021-03-10 05:44:46 EST
Created attachment 285791 [details]
altered block comment