Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
LuaSyntaxHighlighter Class Reference

Syntax highlighter tuned for Lua keywords, strings, numbers, comments and Lua's long-bracket strings/comments. More...

#include <lua_syntax_highlighter.h>

Inheritance diagram for LuaSyntaxHighlighter:

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.

Detailed Description

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.

Member Function Documentation

◆ setColors()

void LuaSyntaxHighlighter::setColors ( const QHash< ThemeManager::ThemeToken, QColor > & colors)

Use colors instead of the live theme, then rehighlight.

Parameters
colorsCode* token to colour; a missing token falls back to the live theme. An empty map means the live theme.

The documentation for this class was generated from the following files: