VSCode:在空行上保持缩进 [英] VSCode: keeping indents on empty lines

查看:35
本文介绍了VSCode:在空行上保持缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以让 VSCode 在空行上保持缩进?

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

在本机和美化"扩展程序中都找不到这样的设置.

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

所需行为示例:

更新:最终我刚刚切换到 Prettier - 并且无需再考虑代码样式,因为它只是为我自动格式化.

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.

推荐答案

转到文件">首选项">设置".在右侧,添加以下行:

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

,"editor.trimAutoWhitespace": false

它非常适合我.

这篇关于VSCode:在空行上保持缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆