Re: wxEditor v0.2 released
- Posted by Greg Haberek Jul 03, 2008
- 801 views
Matt Lewis said...
Ok, loaded a big file, and then it was pretty slow. Actually, the easiest way to speed it up is to not redraw all the lines. In wxSyntax.e:redraw_line() I just did a naive cutoff of 100 lines (so it's drawing too many, but I figure it's unlikely to be showing more than that), and it performs much better:
-- redraw lines bottom = length( text ) if bottom - top > 100 then bottom = top + 100 end if for line = top to bottom do redraw_line( this, line ) end for
Matt
Okay, yeah... I think found it. In redraw_buffer() I have this:
-- redraw lines for line = top to length( text ) do redraw_line( this, line ) end for
But I think it should be something like this:
-- calculate number of lines to drawn bottom = top + maxlines if bottom > length( text ) then bottom = length( text ) end if -- redraw lines for line = top to bottom do redraw_line( this, line ) end for
I haven't tried it, but I suspect that's it. I never really noticed because I was always loading small-ish files.
-Greg