@ 261105.1 · fetching

260808.4.1 · 5ba030cac3c000feb2351ae65bb181ae3a294c1d

https://gitlab.com/saalen/highlight/-/work_items/224 added AnsiIndex theme attribute

Themes had no effect with --out-format=ansi, which emitted one hard coded sequence per element. A theme element may now carry AnsiIndex, a terminal palette index from 0 to 15, which is used for that element instead.

Elements without the attribute keep their previous sequence, so every shipped theme renders unchanged in this format. themes/terminal.theme shows the attribute in use.

reading declarations

Changes to themes/. All files

themes/terminal.theme

new file mode 100644@@ -0,0 +1,43 @@+Description="Terminal palette (ANSI colour indices)"++Categories = {"dark"}++Default        = { Colour="#c0c0c0", AnsiIndex=7 }+Canvas         = { Colour="#000000" }+Number         = { Colour="#00aaaa", AnsiIndex=6 }+Escape         = { Colour="#aa00aa", AnsiIndex=5 }+String         = { Colour="#00aa00", AnsiIndex=2 }+StringPreProc  = { Colour="#55ff55", AnsiIndex=10 }+BlockComment   = { Colour="#555555", AnsiIndex=8 }+PreProcessor   = { Colour="#aa5500", AnsiIndex=3 }+LineNum        = { Colour="#555555", AnsiIndex=8 }+Operator       = { Colour="#c0c0c0", AnsiIndex=7 }+LineComment = BlockComment+Interpolation  = { Colour="#55ffff", AnsiIndex=14 }++Keywords = {+  { Colour="#ffffff", AnsiIndex=15 },+  { Colour="#5555ff", AnsiIndex=12 },+  { Colour="#ff5555", AnsiIndex=9 },+  { Colour="#ff55ff", AnsiIndex=13 },+  { Colour="#ffff55", AnsiIndex=11 },+  { Colour="#55ffff", AnsiIndex=14 },+}++-- new LSP based elements:++SemanticTokenTypes = {+  { Type = 'type', Style = Keywords[2] },+  { Type = 'class', Style = Keywords[1] },+  { Type = 'struct', Style = Keywords[4] },+  { Type = 'interface', Style = Keywords[1] },+  { Type = 'parameter', Style = Keywords[6] },+  { Type = 'variable', Style = Keywords[5] },+  { Type = 'enumMember', Style = Keywords[5] },+  { Type = 'function', Style = Keywords[4] },+  { Type = 'method', Style = Keywords[4] },+  { Type = 'keyword', Style = Keywords[1] },+  { Type = 'number', Style = Number },+  { Type = 'regexp', Style = String },+  { Type = 'operator', Style = Operator },+}