adsr / mle

flexible terminal-based text editor (C)
Apache License 2.0
827 stars 53 forks source link

Is it possible to use bright colors variants in syntax definitions? #45

Closed hovsater closed 4 years ago

hovsater commented 4 years ago

The documentation show that you can set black, red, yellow, blue, magenta, cyan, white as well as bold, underline and reverse. Is it possible to combine these, e.g, bold blue?

adsr commented 4 years ago

Yes, you can bitwise-or the flags.

    fg,bg        0=default     1=black       2=red         3=green
                 4=yellow      5=blue        6=magenta     7=cyan
                 8=white       256=bold      512=underline 1024=reverse

Bold and blue would be 256 + 5 = 261. Demo:

echo -en 'normal_blue\nbold_blue\n' | mle -N -S 'syn_test,.*,4,0' -s 'normal_blue,,5,0' -s 'bold_blue,,261,0' -y syn_test -H0
hovsater commented 4 years ago

Sweet, I'll probably add that to the man page then. 🙂