AStyle built from git 2025-03-14 code produces: (full repro when inside .cpp file)
namespace fff
{
struct LastRunStats
{
};
bool getDefaultSortDirection(ColumnTypeCfg colType)
{
switch (colType)
{
case ColumnTypeCfg::name:
return true;
case ColumnTypeCfg::lastSync:
return false;
case ColumnTypeCfg::lastLog:
return true;
}
return true;
}
}
The expected "switch" indentation should be:
namespace fff
{
struct LastRunStats
{
};
bool getDefaultSortDirection(ColumnTypeCfg colType)
{
switch (colType)
{
case ColumnTypeCfg::name:
return true;
case ColumnTypeCfg::lastSync:
return false;
case ColumnTypeCfg::lastLog:
return true;
}
return true;
}
}
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
This is probably the same error: (full repro when inside .cpp file)
Please try these cases with the latest git version.
The issue seems to be fixed!
Alas, one problematic "switch" remains:
Issue is fixed in the latest version from 2026-02-13! Ticket can be closed.