diff options
author | Neil <nyamatongwe@gmail.com> | 2013-08-07 15:52:25 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2013-08-07 15:52:25 +1000 |
commit | 85441d442a67ecae557e7ec74409d0dc1e3c1cac (patch) | |
tree | e603496a70f0391882ca1d29f7e0fc47b6636f94 /src/PositionCache.h | |
parent | 445144addd4854d8f99d9c87a9c4955556faaa19 (diff) | |
download | scintilla-mirror-85441d442a67ecae557e7ec74409d0dc1e3c1cac.tar.gz |
Optimize performance with many control characters such as when opening
a binary file.
Simplify use of BreakFinder and use for layout as well as drawing.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r-- | src/PositionCache.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h index 10afbd972..a0b805743 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -134,6 +134,15 @@ public: void Clear(); }; +struct TextSegment { + int start; + int length; + Representation *repr; + TextSegment(int start_=0, int length_=0, Representation *repr_=0) : + start(start_), length(length_), repr(repr_) { + } +}; + // Class to break a line of text into shorter runs at sensible places. class BreakFinder { LineLayout *ll; @@ -146,6 +155,7 @@ class BreakFinder { int saeNext; int subBreak; Document *pdoc; + EncodingFamily encodingFamily; SpecialRepresentations *preprs; void Insert(int val); // Private so BreakFinder objects can not be copied @@ -159,8 +169,8 @@ public: BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posLineStart_, int xStart, bool breakForSelection, Document *pdoc_, SpecialRepresentations *preprs_); ~BreakFinder(); - int First() const; - int Next(); + TextSegment Next(); + bool More() const; }; class PositionCache { |