aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-05-30 13:49:50 +1000
committerNeil <nyamatongwe@gmail.com>2018-05-30 13:49:50 +1000
commitd5deb0bf992e06645983ed7e081e2646fc304b86 (patch)
treef4a86002cceb5a02cc61fb907153ee135a07d3c8 /src/PositionCache.cxx
parent5d4ab626a50baab56084cbc61510280ddae174a6 (diff)
downloadscintilla-mirror-d5deb0bf992e06645983ed7e081e2646fc304b86.tar.gz
Add TabPositionAfter method to IScreenLine as this calculation is needed on each
platform and it allows extension to custom tab stops.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r--src/PositionCache.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index 44f9caa0c..599a697db 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -346,6 +346,10 @@ XYPOSITION ScreenLine::RepresentationWidth(size_t position) const {
return ll->bidiData->widthReprs[start + position];
}
+XYPOSITION ScreenLine::TabPositionAfter(XYPOSITION xPosition) const {
+ return (floor((xPosition + TabWidthMinimumPixels()) / TabWidth()) + 1) * TabWidth();
+}
+
LineLayoutCache::LineLayoutCache() :
level(0),
allInvalidated(false), styleClock(-1), useCount(0) {