This project is read-only.

Slow scrollspeed in large documents

Topics: Developer Forum, User Forum
Mar 1, 2007 at 6:01 AM
Hi

Im experiencing a very strange behaviour. If i have a small document, say 40000 lines, page up/down works smoothly. You can hold down page up and the text will just flicker by. However if the document is 1000000 lines we start having problems. When moving up with page up it all works fine but when holding page down it only moves down one page for every half second. Arrow down has the same limitation.

I checked the very same document in Notepad++ (which i believe uses the Scintilla control, natively however) and there it works just smoothly. I have anchored the control in all four sides of a form and when i resize the form it is choppy too, even with only 40000 lines. I could believe this IF i had wrapping on, but word wrap is turned off.

Does anyone know if this is a limitation in .NET or the wrapper or have i seriously mucked up the code?

I setup style 0-32 in the document and i added all text using AddStyledText. Other than that i dont do any specific magic with it.

Im afraid i didnt know what to tag this discussion as either. It is a development question but not development of the actual wrapper so i tagged it both as Developer Forum and User Forum.

Regards,
Per Smitt
Mar 1, 2007 at 6:40 AM
Sorry, it was my own stupidity that caused it. I had thought it was the control, but then i tried the same textfile in SCide and scrolling worked fine. Resizing is still horrible though, both in SCide and my own application.

However what caused my page down to be horrible is the following:
// Page Down
if (e.KeyValue == 34) {
this.Paused = true;
e.Handled = false;
if (scWindow.SelectionStart == scWindow.Text.Length)
{
//Console.WriteLine("Add data from buffer");
PrintBuffer(15);
}
}
The scWindow.SelectionStart == scWindow.Text.Length for checking if im at the end and pressing page down is not so smart ;-)

Anyone know the best way for checking if you are at the end of the document? Im browsing the documentation and the sourcecode and everything but im not certain im coming up with the "right" way to do something.