From 40780f412ede5e9a0aee4378d22909172ad3ace3 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 31 Oct 2003 11:02:04 +0000 Subject: Another wrapping fix. --- src/Editor.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 06ca56366..b1811e075 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3494,7 +3494,9 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { } else { cs.DeleteLines(lineOfPos, -mh.linesAdded); } - CheckModificationForWrap(mh); + } + CheckModificationForWrap(mh); + if (mh.linesAdded != 0) { // Avoid scrolling of display if change before current display if (mh.position < posTopLine) { int newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos()); @@ -6166,8 +6168,11 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_SETMARGINWIDTHN: if (ValidMargin(wParam)) { - vs.ms[wParam].width = lParam; - InvalidateStyleRedraw(); + // Short-circuit if the width is unchanged, to avoid unnecessary redraw. + if (vs.ms[wParam].width != lParam) { + vs.ms[wParam].width = lParam; + InvalidateStyleRedraw(); + } } break; -- cgit v1.2.3