[llvm-bugs] [Bug 42169] New: Clang-format Add Option to Disable the Usage of Tabs for IndentPPDirectives: AfterHash

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 6 09:53:45 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42169

            Bug ID: 42169
           Summary: Clang-format Add Option to Disable the Usage of Tabs
                    for IndentPPDirectives: AfterHash
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: matthias.schaefer at versasec.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

When using tabs as indentation chars, they are also applied to preprocessor
directives after the hash sign, this usually results in a formatting like this:

#if FirstLevel
#       define SecondLevel
#               include "ThirdLevel"

Compared to regular C code, the first level of indentation is offset by one
character because of the hash character. With small tab sizes, you will notice
an irritating difference between the first and second indentation level, and
second and third indentation level:

#if FirstLevel
# define SecondLevel
#   include "ThirdLevel"

This is why I would like to be able to disable the usage of tabulators (only)
for preprocessor indentations. I propose to add an option to
IndentPPDirectives:
AfterHashNoTabs, which will suppress the usage of tabs for preprocessor
indentations after hashes even if the UseTabs setting says so.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190606/d420af66/attachment.html>


More information about the llvm-bugs mailing list