With the following code:
void f()
{
while(false){
}
}
And only "C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "newLine" set (and the other vcFormat settings at defaults), the result of formatting is incorrect:
void f()
{
while (false)
{
}
}
It looks like this was due to multiple internal edits occurring at the same position. VS processes these edits in forward order, whereas we had been processing them in reverse order, on the assumption that this was necessary to avoid impacting the file positions of subsequent edits. Unfortunately, this alters the behavior when multiple internal edits occur at the same position. Fortunately, processing the internal edits in forward order appears to address the issue. (Reversing them was unnecessary).
With the following code:
And only
"C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "newLine"set (and the other vcFormat settings at defaults), the result of formatting is incorrect:It looks like this was due to multiple internal edits occurring at the same position. VS processes these edits in forward order, whereas we had been processing them in reverse order, on the assumption that this was necessary to avoid impacting the file positions of subsequent edits. Unfortunately, this alters the behavior when multiple internal edits occur at the same position. Fortunately, processing the internal edits in forward order appears to address the issue. (Reversing them was unnecessary).