jacobslusser / ScintillaNET

A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
MIT License
964 stars 242 forks source link

Changing EOL type crashes Scintilla #519

Open super-tomcat opened 2 years ago

super-tomcat commented 2 years ago

Using this code to try and change the end of line type and Scintilla will crash the whole app...

Scintilla.ConvertEols(Eol.Cr); Scintilla.Refresh();

VPKSoft commented 2 years ago

I didn't manage to reproduce the bug with the 5.x version of Scintilla.NET. Should the text be something specific to reproduce the error?

super-tomcat commented 2 years ago

Ahh, okay i'll switch over to using the 5.x version... although i am now using my own code to set the line endings which seems to be working fine.

super-tomcat commented 2 years ago

Well i just tried the VPKSoft latest version but unfortunately i had to switch back to this because there is something happening with the cursor (it jumps around) when the cursor is in another textbox which is being displayed anywhere on the screen at the same time as the Scintilla control... is there a property or something i havent seen for this?

VPKSoft commented 2 years ago

Hi This seems to be some kind of focus issue, as one instance of the Scintilla is focused the cursor doesn't jump around anymore. I don't know a fix for jumping yet. A workaround seems to be setting a focus to Scintilla and then jumping goes away for other text boxe(s) as well.

private void FormMain_Shown(object sender, EventArgs e)
{
    scintilla1.Focus();
}

image