将花括号放在代码块周围会导致所有花括号移位,这使其无法正常工作

This is what happens after putting the closing curly bracket under the block of code

有什么原因会发生这种情况?以及如何阻止这种情况的发生?