简体   繁体   中英

Visual Studio Code: Clicking on blank line disrespects indentation

I want to start using VS code but this one issue is driving me insane.

The normal behavior I am expecting is that when I am typing and pressing Enter at the end of a line, the new line is created and indented as expected, following the current scope's indentation:

在此处输入图像描述

My problem is, when I have inserted 2 newlines (pressed enter twice), or clicked on any empty line, the cursor always jumps back to the beginning and does not adhere to the indentation. In the image below I added a new line and then clicked on line 88 and the cursor automatically moved to the start of the line.

在此处输入图像描述

The only setting and suggestions I could find was to change the following setting: "editor.autoIndent": "full" . This however did nothing to help with this issue.

The only extensions installed are C#, Razor/Blazor and Code Spell Checker.

Is there any other setting that can be set to fix this issue?

VSCode automatically clears the indent of empty lines as you can see on the image below:

在此处输入图像描述

There is an issue open on VSCode's GitHub (see #1 ), and requests for a Visual Studio-like solution for it (see #2 ), but it doesn't seem like something that will be implemented soon.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM