martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 260 forks source link

lua: lexers: use style `CODE_BLOCK` in favor of `CODE` #1189

Closed thimc closed 1 month ago

thimc commented 1 month ago

Hi,

Congrats on a new release, here's a PR to fix code highlighting which I noticed while I was migrating from 0.8 to 0.9.

The lexer specs for gemini, markdown and txt2tags use a style named CODE to highlight some form of code (a code block in most situations) but the default theme (base-16) only sets the CODE_BLOCK style so I suppose STYLE_CODE is a bit redundant.

rnpnr commented 1 month ago

Hi! Can you add a style for CODE to the default theme instead? The lexers are vendored in from scintillua so we would prefer to not modify any of those files if it can be avoided.

thimc commented 1 month ago

Hi! Can you add a style for CODE to the default theme instead? The lexers are vendored in from scintillua so we would prefer to not modify any of those files if it can be avoided.

Oh, I see. My reasoning for renaming it to CODE_BLOCK was to follow the naming convention in the theme files, but no worries.

rnpnr commented 1 month ago

Applied in a9a4f5c. I swapped some things around because after looking at it again I think CODE_BLOCK will probably get removed if the ReST lexer is updated.

Thanks for the patch!