|
Wireshark 5.1.0
The Wireshark network protocol analyzer
|
Syntax highlighter tuned for Lua keywords, strings, numbers, comments and Lua's long-bracket strings/comments. More...
#include <lua_syntax_highlighter.h>
Public Member Functions | |
| LuaSyntaxHighlighter (QTextDocument *parent) | |
Build the rule set from the current theme and bind to parent's document. | |
| void | updateColors () |
| Rebuild the rule set from the current theme colours and rehighlight. | |
| void | setColors (const QHash< ThemeManager::ThemeToken, QColor > &colors) |
Use colors instead of the live theme, then rehighlight. | |
Protected Member Functions | |
| void | highlightBlock (const QString &text) override |
| Apply highlighting to a single text block. | |
Syntax highlighter tuned for Lua keywords, strings, numbers, comments and Lua's long-bracket strings/comments.
Colours come from the theme's code section (ThemeManager::Code* tokens). By default they are read from the live theme for the active light/dark mode; call updateColors after a theme or mode change. The Theme Designer passes a draft's colours with setColors instead.
| void LuaSyntaxHighlighter::setColors | ( | const QHash< ThemeManager::ThemeToken, QColor > & | colors | ) |
Use colors instead of the live theme, then rehighlight.
| colors | Code* token to colour; a missing token falls back to the live theme. An empty map means the live theme. |