riched20: Invalidate all the text on bogus last selection.
This commit is contained in:
parent
8a4db52f2a
commit
42d6cc7cf5
|
@ -558,11 +558,11 @@ ME_InvalidateSelection(ME_TextEditor *editor)
|
|||
assert(para2->type == diParagraph);
|
||||
/* last selection markers aren't always updated, which means
|
||||
they can point past the end of the document */
|
||||
if (editor->nLastSelStart > len)
|
||||
editor->nLastSelEnd = len;
|
||||
if (editor->nLastSelEnd > len)
|
||||
editor->nLastSelEnd = len;
|
||||
|
||||
if (editor->nLastSelStart > len || editor->nLastSelEnd > len) {
|
||||
ME_MarkForPainting(editor,
|
||||
ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph),
|
||||
ME_FindItemFwd(editor->pBuffer->pFirst, diTextEnd));
|
||||
} else {
|
||||
/* if the start part of selection is being expanded or contracted... */
|
||||
if (nStart < editor->nLastSelStart) {
|
||||
ME_MarkForPainting(editor, para1, ME_FindItemFwd(editor->pLastSelStartPara, diParagraphOrEnd));
|
||||
|
@ -578,6 +578,7 @@ ME_InvalidateSelection(ME_TextEditor *editor)
|
|||
if (nEnd > editor->nLastSelEnd) {
|
||||
ME_MarkForPainting(editor, editor->pLastSelEndPara, ME_FindItemFwd(para2, diParagraphOrEnd));
|
||||
}
|
||||
}
|
||||
|
||||
ME_InvalidateMarkedParagraphs(editor);
|
||||
/* remember the last invalidated position */
|
||||
|
|
Loading…
Reference in New Issue