Improve formating of macros:

if the line is too long
and can be reduced,
reduce it.
This commit is contained in:
Patrick Pelissier committed 2020-10-21 23:56:55 +02:00
1 parent 54d4b80368
commit f1e2f81e79
1 file changed
+10
+10
View File
@@ -20,6 +20,16 @@ static void format(FILE *f)
}
string_push_back(s, '\\');
}
if (n >= MAX_COLUMN && string_get_char(s, n-1) == '\\') {
n--;
string_left(s, n);
while (n >= MAX_COLUMN-2 && string_get_char(s, n-1) == ' ') {
n--;
string_left(s, n);
}
string_push_back(s, ' ');
string_push_back(s, '\\');
}
printf("%s\n", string_get_cstr(s));
}
string_clear(s);