2

When using Visual Studio 2019, when I hit enter within a block comment in a C++ file it adds a leading * . I've found a solution to this problem for C# at How do I stop Visual Studio from automatically inserting asterisk during a block comment? but the same option is not present for C++ and changing the C# option doesn't disable the feature for C++. This does not occur with Visual Studio 2017.

So when I have:

/*<cursor here>
*/

and I hit enter I want it to look like:

/*
<cursor here>
*/

but instead I get

/*
* <cursor here>
*/

Is there an option somewhere that disables this behavior or another way to do so?

4

2 回答 2

0

根据链接:https ://developercommunity2.visualstudio.com/t/disable-new-extend-multiline-comments-in/1185751

这似乎是一个问题,该问题已在 16.8 中修复。我建议您可以从https://visualstudio.microsoft.com/downloads/安装最新版本。或者您可以更新您的 Visual Studio。

于 2021-04-29T09:34:19.190 回答
0
  • 在VS2019中,点击菜单Tools\Options
  • 在左侧的搜索字段中,键入comment style
  • 在搜索字段下方出现的树视图中,您应该会看到一些节点,选择Text Editor/C/C++树中的底部节点(当前名为General)。
  • 在右侧,您将有一个复选框:
    [x] Insert existing comment style at the start of new lines when writing comments。取消选中。

完毕。

于 2021-04-16T21:19:08.510 回答