Open
Description
Here is a snippet of isolated and formatted C++ code, but in my configuration, it causes the section between "clang-format off" and "clang-format on" to be formatted. It seems that the SeparateDefinitionBlocks option doesn't prevent formatting and still triggers it before the // clang-format on section.
// clang-format off
void function()
{
}
// clang-format on
The formatting result adds an extra line between the function and the // clang-format on comment:
// clang-format off
void function()
{
}
// clang-format on
My environment:
- clang-format version 17.0.6 and version 18.1.4
.clang-format configuration:
Language: Cpp
SeparateDefinitionBlocks: Always