Skip to content

Commit

Permalink
Add a Lua constant for UI_STYLE_LEXER_MAX
Browse files Browse the repository at this point in the history
Currently, there's no mechanism for defining user styles without risk
of collision with default lexer and theme settings.

Very few lexers use more than 10,
let alone all 64 of the allowed styles, so
UI_STYLE_LEXER_MAX - (no. of user defined styles)
allows for a reasonably large number of user-defined styles
before collision becomes a problem.
  • Loading branch information
dther authored and rnpnr committed Apr 21, 2024
1 parent 94c7358 commit f01cf2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vis-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -3276,6 +3276,7 @@ void vis_lua_init(Vis *vis) {
enum UiStyle id;
const char *name;
} styles[] = {
{ UI_STYLE_LEXER_MAX, "STYLE_LEXER_MAX" },
{ UI_STYLE_DEFAULT, "STYLE_DEFAULT" },
{ UI_STYLE_CURSOR, "STYLE_CURSOR" },
{ UI_STYLE_CURSOR_PRIMARY, "STYLE_CURSOR_PRIMARY" },
Expand Down

0 comments on commit f01cf2c

Please sign in to comment.