注释空白行 [英] Commenting blank lines

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

问题描述

使用 ctrl + / 在vs代码中注释多行时,也可以用任何方法注释选择中的空白行。

When commenting multiple lines in vs-code using ctrl + /, is there any way to comment the blank lines in the selection too.

例如,如果我有以下代码,

Example, if I have the following code,

def A():
    line1

    line2

当所有这些行被选中并使用 ctrl + / 发表评论,我希望空白行也能发表评论,例如

When all these lines are selected and commented using ctrl + /, I want the blank line to get commented also, like

# def A():
#     line1
#      
#     line2

而不是:

# def A():
#     line1

#     line2


推荐答案

我正面临在python中使用注释时出现相同的问题设置中有一个选项。
编辑器>注释:插入空间
关闭

I was facing same issue while using comment in python There's an option in setting. Editior >Comments:Insert Space Turn off

这篇关于注释空白行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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