-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
There is a little gripe I have with indent-heuristic = simple
while using the "tabs to indent, spaces to align" styling. For C functions, when parameters are long, I tend to do it like this:
static int my_func(int parameter1,
bool parameter2,
struct sth *parameter3)
/* ^^^^^^^^^^^^^^^
* These are all spaces, to align the parameters with
* the characters of the function header. */
{
/* And the content is then indented with tabs. */
/* snip */
}
With indent = { tab-width = 8, unit = "\t" }
, when I add a new line to the parameters, Helix matches the previous indent by putting as many tabs as can fit, then padding the rest with spaces, like so (with .
being spaces, <------>
being tabs):
static int my_func(int parameter1,
...................bool parameter2,
<------><------>...bool new_parameter, /* added here with o */
...................struct mystruct *parameter3)
{
/* snip */
}
It would be nice to have an indent-heuristic
that simply copies the same exact whitespace onto the new line instead - where there are all tabs, copy tabs; where there are all spaces, copy spaces; if there is some weird mixture, just copy the mixture - i.e. to be even less clever about it.
If there is interest, I am willing to author a PR for this, be it by adding a new special heuristic, or changing the existing simple
one.