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
52 stars 22 forks source link

Lexer Error for ERB (rhtml) files #97

Closed eric-hemasystems closed 1 year ago

eric-hemasystems commented 1 year ago

Since updating the v12 I've been getting errors when trying to edit ERB files. Reduced it down to the following process:

  1. Create a new blank file. I named mine test.html.erb
  2. Insert an extra blank line
  3. A new tab appears outputting the following error: ...ations/Textadept.app/Contents/Resources/lexers/lexer.lua:1205: grammar has no initial rule

I was able to work around this by creating a lexers/rhtml.lua file in my ~/.textadept directory to override the stock lexer. For now I've just make it use the html lexer via return lexer.load('html') so I at least get that syntax highlighting portion.

As an additional quirk, if tabs are disabled via ui.tabs = false then the entire Textadept does a hard crash. I am doing this on a Mac and haven't tested if this is reproducible on other platforms. I'm guessing it's trying to create that new tab with the error but can't or something? This additional bit sounds more like a bug in the Textadept program proper so let me know if you prefer me to report that separately to that project.

orbitalquark commented 1 year ago

Thank for the report. This is a valid issue for Scintillua, as the rhtml lexer seems to be the cause. I'll look into it.

orbitalquark commented 1 year ago

Fixed via https://github.com/orbitalquark/scintillua/commit/028953206432b8572b309224134ccebfdec61e31