rosshemsley / SublimeClangFormat

A C++ code formatter based on Clang Format, for beautiful code with minimal effort in Sublime Text 3
Other
185 stars 52 forks source link

AlignConsecutiveMacros does not work when set through Custom ST settings #67

Open j-rahman opened 3 years ago

j-rahman commented 3 years ago

I have the same style configuration written on a .clang-format file and the clang_format_custom.sublime_settings file (modulo whatever syntactic changes are necessary). The particular line of interest is the following.

"AlignConsecutiveMacros": "Consecutive", // .clang-format has: AlignConsecutiveMacros: Consecutive

Now, when I run this by first changing Clang Format: Select Style to File, then choosing Clang Format: Format Selection, I get the correct result (most of the times): namely, the preprocessor macros of consecutive lines are aligned. However, if I change Clang Format: Select Style to Custom and then choose Clang Format: Format Selection, then the macros are all unaligned.

I am seeing this bug on two of my Fedora 32 machines using Sublime Text 4 (build 4113).

dontblink commented 2 years ago

If you have the PackageResourceViewer plugin in sublime, in clang_format.py add "AlignConsecutiveMacros" to all_settings.