AStyle 3.6.7 produces: (full repro when inside .cpp file)
std::pair<Zstring, ComPtr<IShellItem>> getShellComputerFolder()
{
return {displayName, computerFolder};
}
struct GetItemDetails
{
struct Result
{
std::wstring objectId;
};
Result operator()() const
{
MtpTraverser::MtpItemDetails details = MtpTraverser::getThreadLocalInstance(mtpPath_.deviceDisplayName).
getItemDetails(objectId_, mtpPath_.itemPath);
return {objectId_};
}
};
The expected indentation before "return" should be:
Result operator()() const
{
MtpTraverser::MtpItemDetails details = MtpTraverser::getThreadLocalInstance(mtpPath_.deviceDisplayName).
getItemDetails(objectId_, mtpPath_.itemPath);
return {objectId_};
}
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
I have pushed a fix in the git repo.
It works! :)
BTW thanks for supporting all these different build environments: I downloaded the latest Astyle code from git, opened the vs2022 solution, just compiled: executable built, no errors! My mind is a bit blown by how great this works and how easys it is. I didn't even have to read any documentation, or fiddle with compiler options. It' s like when you're used to torture, but then you're unexpectedly offered a spa...
I have reverted this fix as it was based on a wrong assumption... the problem is the template earlier which triggers the indent in the unrelated code later.
Well back in the day it was no rocket science to compile something which had no third party dependencies. Simple things should be kept simple ;)
I have pushed another variant of the fix.
Thank you! :) Ticket can be closed.