This project is read-only.

Problems with the custom lexer in Scintilla container

Topics: Developer Forum, User Forum
Apr 25, 2015 at 12:51 PM
For very small files the custom lexer in IniLexer.cs seems to work well. But if I have large edit files and make a page down or jump to end of the file, the syntax coloring of the new displayed pages are missing. I then go back to the top of the file and scroll down line by line. Now the syntax coloring works fine but only as long as scroll back line by line.
I then checked the StyleNeeded() function if it is fired and what arguments.
Firing seems to be OK. The argument range.Start gives always the position of the last colored line, even I make a page down. Hence the lexer.Style() function is called with a range.Start too far above in the file. Then firing of StyleNeeded() stops after a number of lines which match the actual display lines but that is mostly also to far above in the edit file.
Has anyone ever used the custum lexer and tested with large files?
Apr 29, 2015 at 3:15 AM
This is likely a failure / shortcoming of the INI lexer and not of Scintilla(NET).

In the new ScintillaNET repository at GitHub there is some documentation on how to write a custom lexer and handle the StyleNeeded event that you may find helpful:
https://github.com/jacobslusser/ScintillaNET

To make sure you are getting the support you need, any additional questions or discussion should be done at GitHub repo.

Jacob