diff options
-rw-r--r-- | src/EditView.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index 72f219fae..0bc950d69 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -387,6 +387,9 @@ void EditView::LayoutLine(const EditModel &model, Sci::Line line, Surface *surfa if (posLineEnd >(posLineStart + ll->maxLineLength)) { posLineEnd = posLineStart + ll->maxLineLength; } + // Hard to cope when too narrow, so just assume there is space + width = std::max(width, 20); + if (ll->validity == LineLayout::ValidLevel::checkTextAndStyle) { Sci::Position lineLength = posLineEnd - posLineStart; if (!vstyle.viewEOL) { @@ -410,7 +413,7 @@ void EditView::LayoutLine(const EditModel &model, Sci::Line line, Surface *surfa const int styleByteLast = (posLineEnd > posLineStart) ? model.pdoc->StyleIndexAt(posLineEnd - 1) : 0; allSame = allSame && (ll->styles[lineLength] == styleByteLast); // For eolFilled if (allSame) { - ll->validity = LineLayout::ValidLevel::positions; + ll->validity = (ll->widthLine != width) ? LineLayout::ValidLevel::positions : LineLayout::ValidLevel::lines; } else { ll->validity = LineLayout::ValidLevel::invalid; } @@ -504,10 +507,6 @@ void EditView::LayoutLine(const EditModel &model, Sci::Line line, Surface *surfa ll->numCharsBeforeEOL = numCharsBeforeEOL; ll->validity = LineLayout::ValidLevel::positions; } - // Hard to cope when too narrow, so just assume there is space - if (width < 20) { - width = 20; - } if ((ll->validity == LineLayout::ValidLevel::positions) || (ll->widthLine != width)) { ll->widthLine = width; if (width == LineLayout::wrapWidthInfinite) { |