Why does formatOnType on for-loop affect other lines? #9983
-
Let's say there is a code like this with for(int i = 0;) // <- the ";" triggers formatting
int foo = 0; The result is for (int i = 0;) int foo = 0; Here my question is why is the In other case, formatOnType only formats the line that is being typed. For example, int foo=0;
int bar=0; // <- Let's say this ";" is just typed is formatted like below int foo=0; // <- this line is not affected
int bar = 0; So why is the first example different? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I'm not able to repro the bug. Can you provide more repro details? What clang-format version are you using? What other clang-format settings are you using? It may be a bug with clang-format itself. If you set C_Cpp.loggingLevel to "Debug", the "C/C++" Output panel will show some formatting logging, i.e. inputs and raw outputs from clang-format which might help. |
Beta Was this translation helpful? Give feedback.
I'm not able to repro the bug. Can you provide more repro details? What clang-format version are you using? What other clang-format settings are you using? It may be a bug with clang-format itself.
If you set C_Cpp.loggingLevel to "Debug", the "C/C++" Output panel will show some formatting logging, i.e. inputs and raw outputs from clang-format which might help.