Latexindent fails to properly indent this code (it removes all indentation, when it should rather leave the indentation alone, or minimally modify it at least).
\ExplSyntaxOn
\newcommand*{\fixcref}{
% Allow spaces in `cref` command.
\cs_set_eq:Nc \bers_cref:nn { @cref }
\cs_generate_variant:Nn \bers_cref:nn { nx }
\cs_set_protected:cpn { @cref } ##1 ##2
{
\seq_set_split:Nnn \l_bers_cref_seq { , } { ##2 }
\bers_cref:nx { ##1 } { \seq_use:Nn \l_bers_cref_seq { , } }
}
\seq_new:N \l_bers_cref_seq
}
\ExplSyntaxOff
##1 ##2and the single{on the next line creates the problem. With regular arguments (#1 #2) or something else on the next line (\a{for example) the indentation is ok. Looks like a bug, maybe you can post an issue in the issue tracker. – Marijn Feb 03 '21 at 08:03%\begin{noindent}and%\end{noindent}around the command, this will stop Latexindent from formatting it. – Marijn Feb 03 '21 at 12:54