On Fri, 2022-11-18 at 18:43 +0100, Thibaut Cuvelier wrote: > You can avoid this level of indentation by defining the variable > within the if: > > if (const vector<docstring> potential_terms = > getSubentriesAsText(runparams); !potential_terms.empty()) { > > I don't really like this syntax, because it makes extremely long > lines, but it has strong advantages.
This helps a bit: if (const auto potential_terms = getSubentriesAsText(runparams); !potential_terms.empty()) {...} Using const auto and aligning the condition with the opening parenthesis. FWIW I think that using curly brackets just to define the variable's scope is ugly. :-) This is an aesthetic opinion but the issue is also just aesthetic. :-D Best regards, -- José Abílio -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel