From dd70872fc8d334ebe216ce31f292c0501ce52058 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 6 Jul 2009 02:36:39 +0000 Subject: Fix up some drawing glitches with end of line selection not being removed. --- src/Editor.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 88fd0bbeb..a2abba607 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -711,9 +711,10 @@ void Editor::InvalidateSelection(SelectionRange newMain, bool invalidateWholeSel if (sel.Count() > 1 || !(sel.RangeMain().anchor == newMain.anchor) || sel.IsRectangular()) { invalidateWholeSelection = true; } - int firstAffected = newMain.Start().Position(); + int firstAffected = Platform::Minimum(sel.RangeMain().Start().Position(), newMain.Start().Position()); // +1 for lastAffected ensures caret repainted int lastAffected = Platform::Maximum(newMain.caret.Position()+1, newMain.anchor.Position()); + lastAffected = Platform::Maximum(lastAffected, sel.RangeMain().End().Position()); if (invalidateWholeSelection) { for (size_t r=0; r