Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327559 - have the CDT formatter respect 'indent' style no-format sections with the "*INDENT-OFF*" & "*INDENT-ON* tokens
Summary: have the CDT formatter respect 'indent' style no-format sections with the "*I...
Status: CLOSED DUPLICATE of bug 496249
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 7.0   Edit
Hardware: All All
: P3 enhancement with 6 votes (vote)
Target Milestone: 9.7.0   Edit
Assignee: Project Inbox CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
: 285900 419978 453926 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-12 10:14 EDT by Sagie CLA
Modified: 2019-02-20 03:19 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sagie CLA 2010-10-12 10:14:21 EDT
Build Identifier: 

enable code sections to be annotated with "/* *INDENT-OFF* */" & "/* *INDENT-ON* */ tokens to disable auto-formatting. This will enable protecting special code sections such as [1] which should be indented by hand.

referred section brought here for conveniences:

  static const struct linedraw cstable[]={
    { latin1_3,    "|  ",              "|--",            "·--",     "©"   },
    { iso8859_789, "|  ",              "|--",            "·--",     "(c)"      },
    { shift_jis,   "\204\240 ",        "\204\245",       "\204\244",       "(c)"      },
    { euc_jp,      "\250\242 ",        "\250\247",       "\250\246",       "(c)"      },
    { euc_kr,      "\246\242 ",        "\246\247",       "\246\246",       "(c)"      },
    { iso2022jp,   "\033$B(\"\033(B ", "\033$B('\033(B", "\033$B(&\033(B", "(c)"      },
    { ibm_pc,      "\263  ",           "\303\304\304",   "\300\304\304",   "(c)"      },
    { ibm_ps2,     "\263  ",           "\303\304\304",   "\300\304\304",   "\227"     },
    { ibm_gr,      "\263  ",           "\303\304\304",   "\300\304\304",   "\270"     },
    { gb,          "\251\246 ",        "\251\300",       "\251\270",       "(c)"      },
    { utf8,        "\342\224\202\302\240\302\240",
                   "\342\224\234\342\224\200\342\224\200", "\342\224\224\342\224\200\342\224\200", "\302\251" },
    { big5,        "\242x ",           "\242u",          "\242|",          "(c)"      },
    { viscii,      "|  ",              "|--",            "`--",            "\371"     },
    { koi8ru,      "\201  ",           "\206\200\200",   "\204\200\200",   "\277"     },
    { windows,     "|  ",              "|--",            "`--",            "\251"     },
    { NULL,        "|  ",              "|--",            "`--",            "(c)"      }
  };


[1] ftp://mama.indstate.edu/linux/tree/tree-1.5.3.tgz, file: tree.c, line: ~1766

Reproducible: Always
Comment 1 Anton Leherbauer CLA 2010-10-22 04:31:40 EDT
See also JDT bug 27079.
Comment 2 tim.froidcoeur+eclipse CLA 2011-04-07 07:38:52 EDT
JDT uses 
//@formatter:on 
and 
//@formatter:off

maybe it makes sense to honor these same directives?
Comment 3 Chris Brown CLA 2013-04-23 20:42:21 EDT
JDT also has this as a configurable option with the default being off.  I agree that CDT should follow the JDT defaults on this.
Comment 4 Marc Khouzam CLA 2015-07-15 13:37:58 EDT
*** Bug 453926 has been marked as a duplicate of this bug. ***
Comment 5 Nathan Ridge CLA 2017-01-10 20:28:56 EST
*** Bug 285900 has been marked as a duplicate of this bug. ***
Comment 6 Nathan Ridge CLA 2017-02-21 20:59:39 EST
*** Bug 419978 has been marked as a duplicate of this bug. ***
Comment 7 Marco Stornelli CLA 2019-02-20 01:08:38 EST
This bug has been already been fixed, (see but 496249).
Comment 8 Marco Stornelli CLA 2019-02-20 01:09:38 EST
I meant bug 496249
Comment 9 Nathan Ridge CLA 2019-02-20 03:19:39 EST
Thanks, closed as dupe.

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