diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 22 | 
1 files changed, 17 insertions, 5 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 01f55b333..fb7f4c636 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4513,14 +4513,12 @@ void Editor::NotifySavePoint(Document *, void *, bool atSavePoint) {  void Editor::CheckModificationForWrap(DocModification mh) {  	if (mh.modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) {  		llc.Invalidate(LineLayout::llCheckTextAndStyle); +		int lineDoc = pdoc->LineFromPosition(mh.position); +		int lines = Platform::Maximum(0, mh.linesAdded);  		if (wrapState != eWrapNone) { -			int lineDoc = pdoc->LineFromPosition(mh.position); -			int lines = Platform::Maximum(0, mh.linesAdded);  			NeedWrapping(lineDoc, lineDoc + lines + 1);  		}  		// Fix up annotation heights -		int lineDoc = pdoc->LineFromPosition(mh.position); -		int lines = Platform::Maximum(0, mh.linesAdded);  		SetAnnotationHeights(lineDoc, lineDoc + lines + 2);  	}  } @@ -6724,8 +6722,22 @@ void Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) {  void Editor::SetAnnotationHeights(int start, int end) {  	if (vs.annotationVisible) { +		bool changedHeight = false;  		for (int line=start; line<end; line++) { -			cs.SetHeight(line, pdoc->AnnotationLines(line) + 1); +			int linesWrapped = 1; +			if (wrapState != eWrapNone) { +				AutoSurface surface(this); +				AutoLineLayout ll(llc, RetrieveLineLayout(line)); +				if (surface && ll) { +					LayoutLine(line, surface, vs, ll, wrapWidth); +					linesWrapped = ll->lines; +				} +			} +			if (cs.SetHeight(line, pdoc->AnnotationLines(line) + linesWrapped)) +				changedHeight = true; +		} +		if (changedHeight) { +			Redraw();  		}  	}  }  | 
