Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt Creator 7.0.2
-
None
Description
there is a small issue with the clang-format plugin.
consider this code:
struct foo { int bar; float baz; };
when clang-format's alignment options are used, `bar` and `baz` are aligned.
now, if the code is changed so something like:
struct foo {
a_really_really_long_type bar;
float baz;
};
saving the file with qt-creator will run clang-format, but not on the full file, but only on the changed lines. so `bar` and `baz` are not aligned, since the line declaring `baz` has not been changed. if this line is modified however, saving the file will align `bar` and `baz` as expected.
i suppose there is some kind of application logic which does not run clang-format on the full file, but only on modified lines. this is a bit surprising to me, as i'd expect it to format the whole file. it smells more like a bug than a feature, but if it's a feature, maybe it can be exposed via an option?