https://bugs.llvm.org/show_bug.cgi?id=38381
Bug ID: 38381
Summary: Support using tab for continuation indent while
keeping to use spaces for continuation alignment
Product: clang
Version: 6.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Formatter
Assignee: unassignedclangb...@nondot.org
Reporter: lassi.niemi...@wapice.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org
In our project, we have the rule to use tabs for indentation and spaces for
alignment (starting from the indentation level).
Clang-format makes a difference between indentation (block indentation) and
continuation (any indentation or alignment of the splitted lines). This kind of
makes sense, but at the same time it forces to use either tabs or spaces for
both cases, as controlled by UseTab=ForContinuationAndIndentation.
Examples (Tab='--->', space='.')
--------------------------------
With
UseTab: ForContinuationAndIndentation
ContinuationIndentWidth: '4'
--->--->int file =
--->--->--->open(logfile_path, ???);
--->--->myFunction(param1,
--->--->--->--->...param2, // tabs used for alignment (bad)
--->--->--->--->...param3);
With
UseTab: ForIndentation
ContinuationIndentWidth: '4'
--->--->int file =
--->--->....open(logfile_path, ???); // spaces used for indent (bad)
--->--->myFunction(param1,
--->--->...........param2,
--->--->...........param3);
I would assume there are others that would like to follow the similar rules, so
could there be an option e.g. UseTab:ForContinuationIndentAndIndentation or
just change the current behavior and never use tabs for alignment (does someone
really like to use it that way, i wonder).
Desired output:
--->--->int file =
--->--->--->open(logfile_path, ???); // indent
--->--->myFunction(param1,
--->--->...........param2, // alignment
--->--->...........param3);
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs