diff options
| author | Zufu Liu <unknown> | 2020-08-27 23:39:28 +1000 | 
|---|---|---|
| committer | Zufu Liu <unknown> | 2020-08-27 23:39:28 +1000 | 
| commit | 94e9667661f8997babb3667be1e9f2ccec206d4f (patch) | |
| tree | f46361072e911cca0d1317585fef503c3764080a | |
| parent | a4932dda62685856670a782c92d7eebc8afb8bf2 (diff) | |
| download | scintilla-mirror-94e9667661f8997babb3667be1e9f2ccec206d4f.tar.gz | |
Bug [#2197]. Avoid rewrap when checkTextAndStyle finds unchanged from cache.
| -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) {  | 
