0

I want code to be formatted using tabs only, with no space alignment. Something like astyle -T -S -p -xg -H -U -xU does.

For example, clang-format gives me the following results:

        SelEnd = StrSize; // а также считаем что все выделено -
                          // надо же отличаться от обычных Edit
...
            for (int j = 0, S = TabSize - ((LeftPos + OutStrCells) % TabSize); j < S && int(OutStrCells) < EditLength;
                 ++j, ++OutStrCells) {
...
                FS << fmt::Cells() << fmt::Skip(CellSelStart) << fmt::Truncate(CellSelEnd - CellSelStart)
                   << OutStr.data();

but I want it to use tab indentation instead of space alignment. How can I achieve it? (Looks like stackoverflow replaces tabs to spaces. Just assume any 4 spaces are tab in examples above)

I use the following clang-format configuration file:

---
IndentWidth: 4
TabWidth: 4
UseTab: Always
AlignAfterOpenBracket: DontAlign
ColumnLimit: 120
AlignOperands: DontAlign
BreakConstructorInitializers: AfterColon
unxed
  • 196
  • 1
  • 3
  • 6
  • Seems like the left shift operator has special handling and ignores `AlignOperands: DontAlign`. For comments, maybe the new `AlignTrailingComments: Leave` helps. – krisz Mar 15 '23 at 20:04

0 Answers0