简体   繁体   English

C++ Visual Studio - 如何在行尾添加注释

[英]C++ Visual Studio - How to tab at end of line to add comment

This is a stupid and frustrating thing.这是一件愚蠢而令人沮丧的事情。 Working with VS 2019 after a few years away, and I cannot remember the option to allow me to tab at the end of a line to add an end-of-line comment.几年后使用 VS 2019,我不记得允许我在行尾使用 Tab 来添加行尾注释的选项。 The cursor just sits there when I hit tab at the end of当我在最后点击 Tab 时,光标就在那里

int frustrationLevel = 99;

I want to tab after the semicolon dagnabit!我想在分号 dagnabit 后面打标签!

int frustrationLevel = 99;    // omg please help me!

I know this used to be possible.我知道这曾经是可能的。

TIA!蒂亚!

After comparing option after option with a previous version of VS where the tab worked as desired, I found an option that was set在将选项后选项与选项卡按需要工作的先前版本的 VS 进行比较后,我发现了一个已设置的选项

Options -> Text Editor -> C/C++ -> Code Style -> Formatting -> General :: Automatically indent when I type a tab.选项 -> 文本编辑器 -> C/C++ -> 代码样式 -> 格式 -> 常规 :: 键入选项卡时自动缩进。

Unchecking this option fixed my issue.取消选中此选项解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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