aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2014-09-05 14:29:55 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2014-09-05 14:29:55 +1000
commitfd6f558374a70cd51e4395f0c761c4586d687984 (patch)
tree2cc302232e23f8227ce162f4412f0252a5ae2e75 /src/EditView.cxx
parente2144921e8113a36f01ae029af0ce7924f233613 (diff)
downloadscintilla-mirror-fd6f558374a70cd51e4395f0c761c4586d687984.tar.gz
Bug [#1652]. Revert to allowing fractional tab stops.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index c46a0fbcf..7d5860ef8 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -215,11 +215,11 @@ void EditView::ClearAllTabstops() {
ldTabstops = 0;
}
-int EditView::NextTabstopPos(int line, int x, int tabWidth) const {
- int next = GetNextTabstop(line, x);
+XYPOSITION EditView::NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const {
+ int next = GetNextTabstop(line, static_cast<int>(x + 2));
if (next > 0)
- return next;
- return ((((x + 2) / tabWidth) + 1) * tabWidth);
+ return static_cast<XYPOSITION>(next);
+ return (static_cast<int>((x + 2) / tabWidth) + 1) * tabWidth;
}
bool EditView::ClearTabstops(int line) {
@@ -452,9 +452,8 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co
XYPOSITION representationWidth = vstyle.controlCharWidth;
if (ll->chars[ts.start] == '\t') {
// Tab is a special case of representation, taking a variable amount of space
- const int x = static_cast<int>(ll->positions[ts.start]);
- const int tabWidth = static_cast<int>(vstyle.tabWidth);
- representationWidth = static_cast<XYPOSITION>(NextTabstopPos(line, x, tabWidth) - ll->positions[ts.start]);
+ const XYPOSITION x = ll->positions[ts.start];
+ representationWidth = NextTabstopPos(line, x, vstyle.tabWidth) - ll->positions[ts.start];
} else {
if (representationWidth <= 0.0) {
XYPOSITION positionsRepr[256]; // Should expand when needed