aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.h
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2016-11-05 20:32:17 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2016-11-05 20:32:17 +1100
commit8a62263409f5d222ac0d0ccf7bf0e7e0261224a8 (patch)
tree2fa3fea045c228d40e8a812b8553afd21f7f168a /src/PositionCache.h
parent1e36c7e89248cf5f9e4353673918e79cfcaeb857 (diff)
downloadscintilla-mirror-8a62263409f5d222ac0d0ccf7bf0e7e0261224a8.tar.gz
Add options to choose between the locations of a position when there
are multiple locations for one position. The main current use is to find the location at the end of a line or display line when the commonly used location is at the start of the next line.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r--src/PositionCache.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h
index edc0a5ddb..5a829b76b 100644
--- a/src/PositionCache.h
+++ b/src/PositionCache.h
@@ -16,6 +16,15 @@ static inline bool IsEOLChar(char ch) {
return (ch == '\r') || (ch == '\n');
}
+// There are two points for some positions and this enumeration
+// can choose between the end of the first line or subline
+// and the start of the next line or subline.
+enum PointEnd {
+ peDefault = 0x0,
+ peLineEnd = 0x1,
+ peSubLineEnd = 0x2
+};
+
/**
*/
class LineLayout {
@@ -28,6 +37,7 @@ private:
bool inCache;
public:
enum { wrapWidthInfinite = 0x7ffffff };
+
int maxLineLength;
int numCharsInLine;
int numCharsBeforeEOL;
@@ -64,7 +74,7 @@ public:
void RestoreBracesHighlight(Range rangeLine, const Position braces[], bool ignoreStyle);
int FindBefore(XYPOSITION x, int lower, int upper) const;
int FindPositionFromX(XYPOSITION x, Range range, bool charPosition) const;
- Point PointFromPosition(int posInLine, int lineHeight) const;
+ Point PointFromPosition(int posInLine, int lineHeight, PointEnd pe) const;
int EndLineStyle() const;
};