Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stackoverflow Exception #2

Open
LucidaDragon opened this issue Jan 26, 2018 · 4 comments
Open

Stackoverflow Exception #2

LucidaDragon opened this issue Jan 26, 2018 · 4 comments

Comments

@LucidaDragon
Copy link

`Private Highlighter As New Highlight.Highlighter(New Highlight.Engines.RtfEngine)

Private Sub RichTextBox1_TextChanged(sender As Object, e As EventArgs) Handles RichTextBox1.TextChanged
    RichTextBox1.Rtf = Highlighter.Highlight("Python", RichTextBox1.Text)
End Sub`

Throws a stackoverflow exception when highlighter.highlight is called for the first time. Am I doing something wrong?

@thomasjo
Copy link
Owner

Would it be possible for you to share some example code that reproduces the problem? That would make it a lot easier for me to investigate, and hopefully fix the bug.

@LucidaDragon
Copy link
Author

The code I posted above is the only code I had. To reproduce: Create a WinForm with a RichTextBox. In the form's code, construct a new Highlighter with the Rtf engine, then add an event handler for the RichTextBox's TextChanged event and use it to call Highlight("Python", RichTextBox1.Text)

@LucidaDragon
Copy link
Author

When a character is entered into the RichTextBox, there is a huge menory spike before getting a stack overflow exception.

@msdobrescu
Copy link

How this library is supposed to be used?
Some may imagine it would be a live highlighter, but no.
This stack overflow occurs by calling that processing in the control text changed event, so it would occur because the text is changed again and again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants