diff options
author | Neil <nyamatongwe@gmail.com> | 2021-08-14 21:54:08 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-08-14 21:54:08 +1000 |
commit | fdd749210d8a813332d8789634b8c82aae14e9d7 (patch) | |
tree | f19364322e6fa335823c6cd1b89c99f969aa48b4 /src/Editor.h | |
parent | 551135e71f5196ee1fd92e017db8a704eb11f63b (diff) | |
download | scintilla-mirror-fdd749210d8a813332d8789634b8c82aae14e9d7.tar.gz |
Optimize by reducing invalidation as this can be costly.
If all of the text area or margin area is invalidated then remember this and
don't do any more invalidations for that area until the window is painted.
This reduced the time taken to replace each \r\n with \n\n in very large
files by a factor of 3.
Diffstat (limited to 'src/Editor.h')
-rw-r--r-- | src/Editor.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Editor.h b/src/Editor.h index 417700ed5..37df93c93 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -188,6 +188,10 @@ protected: // ScintillaBase subclass needs access to much of Editor Window wMain; ///< The Scintilla parent window Window wMargin; ///< May be separate when using a scroll view for wMain + // Optimization that avoids superfluous invalidations + bool redrawPendingText = false; + bool redrawPendingMargin = false; + /** Style resources may be expensive to allocate so are cached between uses. * When a style attribute is changed, this cache is flushed. */ bool stylesValid; |