简体   繁体   English

Visual Studio C ++,如何更改“nullptr”的文本颜色

[英]Visual Studio C++, how to change the text color for “nullptr”

It's distracting to me to see keywords like class, for, while in bright blue, but also to have nullptr in bright blue. 看到类似于类的关键字时,让我分心的是,虽然是亮蓝色,但也有明亮的蓝色的nullptr。 It draws attention to the word "nullptr". 它提请注意“nullptr”这个词。 Is there any way to override VS's coloring for just this word? 有没有办法覆盖这个词的VS着色?

Right now I am using #define null nullptr , which is a workaround at least for my own code. 现在我正在使用#define null nullptr,这至少对我自己的代码来说是一种解决方法。

Visual Studio doesn't allow you override keyword coloring feature. Visual Studio不允许您覆盖关键字着色功能。 There is no direct way! 没有直接的方法! However, It is possible by writing your own Syntax Colorizing plugin. 但是,可以通过编写自己的语法着色插件来实现。

Find more information here: Syntax Colorizing (Managed Package Framework) 在此处查找更多信息: 语法着色(托管包框架)

You can filter nullptr keyword in ScanTokenAndProvideInfoAboutIt () function. 您可以在ScanTokenAndProvideInfoAboutIt ()函数中过滤nullptr关键字。

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

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