@nyamatongwe commented on this pull request.
@@ -877,6 +939,21 @@ static void styleset_from_mapping(ScintillaObject *sci, guint ft_id, guint lexer
if (styles[i].fill_eol) SSM(sci, SCI_STYLESETEOLFILLED, styles[i].style, TRUE); set_sci_style(sci, styles[i].style, ft_id, i); + if (styles[i].sub_stylable) + { + LexerStyle *style = &style_sets[ft_id].styles[i]; + + if (style->sub.count) + { + /* FIXME: can substyle allocation fail? and how do we know? */
Lexers have a limited number of substyles since they are styles and styles are 8-bit values. Since lexers use styles for other purposes, lexers that support substyles commonly support 64. `SCI_ALLOCATESUBSTYLES` returns a negative number when it fails such as exhausting available substyles. Currently failure only returns -1, but there could be other error codes in the future. Added to documentation with https://sourceforge.net/p/scintilla/code/ci/372e3958c9ce05f59012ca695d8679d0...