Home > Back-end >  Why is indentation different in editor and terminal with VSCODE?
Why is indentation different in editor and terminal with VSCODE?

Time:12-23

After updating VSCODE to the latest version, the editor and the terminal show different indentation. Following figures present the format of the code in the editor and terminal, respectively.

Code in editor

Code in editor

Code in terminal

Code in terminal

How can I keep the same indentation?

CodePudding user response:

Since you are using the radian console you probably need bracketed paste mode for sending code. Enable it by adding this to your settings.json:

"r.bracketedPaste": true

CodePudding user response:

There are a few potential reasons why the indentation in the editor and terminal might be different after updating VSCODE:

  1. Different settings: The editor and terminal might be using different settings for indentation. You can check the settings for the editor and terminal and make sure they are set to the same values.

  2. Different file encoding: The editor and terminal might be using different file encodings, which can cause differences in indentation. You can check the encoding of the file in the editor and make sure it matches the encoding being used by the terminal.

  3. Different line ending characters: The editor and terminal might be using different line ending characters, which can also cause differences in indentation. You can check the line ending characters being used in the editor and make sure they match the ones being used in the terminal.

  4. Different versions of the programming language: The editor and terminal might be using different versions of the programming language, which can cause differences in the way indentation is handled. You can check the versions of the programming language being used in the editor and terminal and make sure they are compatible.

To resolve the issue, you can try adjusting the settings, encoding, line ending characters, or programming language versions to match between the editor and terminal. If the problem persists, you may need to further troubleshoot the issue by checking for any conflicting extensions or configurations.

  • Related