diff options
author | Neil <nyamatongwe@gmail.com> | 2015-11-11 19:14:30 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2015-11-11 19:14:30 +1100 |
commit | fc7f7bed53a60d2d3785cf95093d388d39b2af11 (patch) | |
tree | 6b1030593ef0c6e8815c356269b8722d1109017c /cocoa | |
parent | 4a52b4ef384436f5474184588ecacf666369afa0 (diff) | |
download | scintilla-mirror-fc7f7bed53a60d2d3785cf95093d388d39b2af11.tar.gz |
Implemented idle styling. This allows painting without first styling all visible
text then styling in the background using idle-time.
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 8b95aae0e..982ca0423 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1801,13 +1801,15 @@ void ScintillaCocoa::WillDraw(NSRect rect) { RefreshStyleData(); PRectangle rcWillDraw = NSRectToPRectangle(rect); - int positionAfterRect = PositionAfterArea(rcWillDraw); - pdoc->EnsureStyledTo(positionAfterRect); + const int posAfterArea = PositionAfterArea(rcWillDraw); + const int posAfterMax = PositionAfterMaxStyling(posAfterArea, true); + pdoc->StyleToAdjustingLineDuration(posAfterMax); + StartIdleStyling(posAfterMax < posAfterArea); NotifyUpdateUI(); if (WrapLines(wsVisible)) { // Wrap may have reduced number of lines so more lines may need to be styled - positionAfterRect = PositionAfterArea(rcWillDraw); - pdoc->EnsureStyledTo(positionAfterRect); + const int posAfterAreaWrapped = PositionAfterArea(rcWillDraw); + pdoc->EnsureStyledTo(posAfterAreaWrapped); // The wrapping process has changed the height of some lines so redraw all. Redraw(); } |