riched20: ME_SetSelection -1 to -1 behavior fix.

This commit is contained in:
Hippocrates Sendoukas 2006-09-02 20:12:06 -07:00 committed by Alexandre Julliard
parent 382d06794b
commit 0134e8f7d0
1 changed files with 8 additions and 0 deletions

View File

@ -90,6 +90,14 @@ void ME_SetSelection(ME_TextEditor *editor, int from, int to)
ME_ClearTempStyle(editor);
return;
}
if (from == -1 && to == -1) /*-1,-1 means put the selection at the end of the text */
{
editor->pCursors[1].pRun = editor->pCursors[0].pRun = ME_FindItemBack(editor->pBuffer->pLast, diRun);
editor->pCursors[1].nOffset = editor->pCursors[0].nOffset = 0;
ME_InvalidateSelection(editor);
ME_ClearTempStyle(editor);
return;
}
if (from == -1)
{
editor->pCursors[1] = editor->pCursors[0];