Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
253 views
in Technique[技术] by (71.8m points)

visual studio code - VSCode: keeping indents on empty lines

Is it possible to make VSCode keep indents on empty lines?

Could not find such a setting neither natively nor in "Beautify" extension.

Example of desired behavior:

enter image description here

UPDATE: eventually I've just switched to Prettier - and never had to think about code style again as it's just being formatted automatically for me.

question from:https://stackoverflow.com/questions/47968474/vscode-keeping-indents-on-empty-lines

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Go to File > Preferences > Settings. On the right side, add the line:

,"editor.trimAutoWhitespace": false

It worked for me perfectly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...