orbitalquark / scintillua

Scintillua enables Scintilla lexers to be written in Lua, particularly using LPeg. It can also be used as a standalone Lua library for syntax highlighting support.
https://orbitalquark.github.io/scintillua
MIT License
51 stars 20 forks source link

lexer.FOLD_HEADER, lexer.FOLD_BASE and lexer.FOLD_BLANK are nil #113

Closed jxzwp closed 2 months ago

jxzwp commented 3 months ago

lexer.FOLD_HEADER, lexer.FOLD_BASE and lexer.FOLD_BLANK always evaluate to nil because they are never assigned to at the module level in lexer.lua.

They are only assigned to locals within lexer.fold()here

https://github.com/orbitalquark/scintillua/blob/44d0dd1d7d77b5391c0f4044b8853bbd511dc339/lexers/lexer.lua#L1273

Also this causes an error when using the rest lexer which overrides lexer.fold(). See here https://github.com/orbitalquark/scintillua/blob/44d0dd1d7d77b5391c0f4044b8853bbd511dc339/lexers/rest.lua#L181

orbitalquark commented 2 months ago

Thanks for catching this. It should be fixed in https://github.com/orbitalquark/scintillua/commit/0c9294695920daa397a67d960e003908c5979bb3