From a65c538fcfecafcefed34078e7671bc4ea6ed1ec Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 14 Feb 2015 06:34:29 +0100 Subject: fixed tab stop calculation on Curses * 2 was added to the current X position before calculating the next tab stop. On non-Curses platforms this did not hurt since the X position is in pixels. On Curses, the "width" of each character is 1. * I don't know whether this change has any effect on the other (non-curses) platforms. The algorithm was similar since the very beginning of Scintilla (initial commit), so no explanation is given in the commit log. --- src/EditView.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EditView.cxx b/src/EditView.cxx index 4976d3614..1ff0b695d 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -220,10 +220,10 @@ void EditView::ClearAllTabstops() { } XYPOSITION EditView::NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const { - int next = GetNextTabstop(line, static_cast(x + 2)); + int next = GetNextTabstop(line, static_cast(x)); if (next > 0) return static_cast(next); - return (static_cast((x + 2) / tabWidth) + 1) * tabWidth; + return (static_cast(x / tabWidth) + 1) * tabWidth; } bool EditView::ClearTabstops(int line) { -- cgit v1.2.3