我已经完成了以下操作,但这不是这里的问题。
How to change background color in the Notepad++ text editor?
我正在使用 Notepad++ 在python中编程并应用深黑色其中有黑色背景和白色文本颜色的主题。
键入函数时,它显示 函数语法 在具有白色背景的工具提示中 对比与黑色背景的记事本。
我已经在 Style Configurator 中搜索过,但没有运气。
如何更改工具提示的背景颜色?
最佳答案
Notepad++ 使用 闪烁 作为其编辑器组件。 calltip 功能直接来自 scintilla。对于在 Notepad++ 的 gui 中没有直接配置选项的 scintilla 功能(calltip 样式似乎是这样的功能),您需要一个方法来 向 Scintilla 发送消息 .
一种方法(也是我所知道的唯一一种除了编写插件之外的方法)是使用 NppExec 插件 .它提供了一个 SCI_SENDMSG
命令。 scintilla website提供有关每条可能消息的详细文档。对于您的用例,它说:
Call tips are small windows displaying the arguments to a function and are displayed after the user has typed the name of the function. They normally display characters using the font facename, size and character set defined by STYLE_DEFAULT. You can choose to use STYLE_CALLTIP to define the facename, size, foreground and background colours and character set with SCI_CALLTIPUSESTYLE. This also enables support for Tab characters. There is some interaction between call tips and autocompletion lists in that showing a call tip cancels any active autocompletion list, and vice versa.
因此我们需要发送
SCI_CALLTIPUSESTYLE
消息和(继续在网站上阅读)我们可以使用 SCI_CALLTIPSETBACK
配置前景色和背景色和 SCI_CALLTIPSETFORE
.因此,要通过使用 NppExec 向 Scintilla 编辑器组件发送消息来设置 calltip 的颜色,您需要执行以下操作:
Scintilla.h
它具有可能的消息的所有定义。 // use CALLTIPSTYLE instead DEFAULT
SCI_SENDMSG SCI_CALLTIPUSESTYLE 0
// background to black ( 0 )
SCI_SENDMSG SCI_CALLTIPSETBACK 0
// foreground to white ( 0xffffff )
SCI_SENDMSG SCI_CALLTIPSETFORE 0xffffff
现在您的 calltip Window 应该是黑底白字,您可能希望通过更改参数来采用颜色。
如果一切正常,那么 Plugins -> NppExec -> Advanced Options 提供选项 Notepad++ 启动时执行此脚本 在配置对话框的右上角区域。在下面选择脚本名称
您保存了该行(例如 SetCallTipSTLye)
唉,我一直无法找到如何配置自动完成样式。我希望它会使用与 calltip 样式相同的样式,但自动补全保持黑底白字。
关于themes - 在 Notepad++ 中更改功能工具提示的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46364241/