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 | 28f221692fdfbd3943fbab0d2f65a72923b8b6e7 (patch) | |
tree | fcfe61ed4a5f04aa62cca2cb0a192d91024c9daf /src/PositionCache.h | |
parent | 90a63d33ad8b351f3776f39dc87c1952c2116d4b (diff) | |
download | scintilla-mirror-28f221692fdfbd3943fbab0d2f65a72923b8b6e7.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 { |