AStyle 3.6.7 produces: (full repro when inside .cpp file)
struct Win32Traverser
{
class DirReader
{
public:
explicit DirReader(const Zstring& dirPath)
{
}
private:
WIN32_FIND_DATA data_;
bool haveFirstData_ = false;
};
};
The "public" should be indented one tab less, the "private" one tab more.
using
--style=allman
--suffix=none
--keep-one-line-blocks
--align-pointer=type
--min-conditional-indent=0
--max-continuation-indent=80
--indent-switches
--indent-col1-comments
--indent-preproc-block
--indent-preproc-define
--pad-header
--pad-comma
--formatted
--lineend=linux
--indent-preproc-block
--convert-tabs
--preserve-ws
Thanks so much for your continuing support of the best C++ code formatter! (leaving others like clang-format in the dust!)
Hi, this is a known bug I will tackle next. structs are a bit tricky for astyle.
clang-format has more advanced insight into the code structure, but still lacks some astyle features ;)
I have pushed a fix in the git repo.
It works! :)
Unfortunately this example doesn't work yet:
should be
Hi, I pushed another fix
This is a major improvement! Most issues are gone, but not the following:
Here's a probably related issue with function "missingIndent()":
Please try again with the latest version in git.
Awesome! I seem to have run out of any more of these issues :D The ticket can probably be closed.