Commit bb9631b1 authored by Phil Krylov's avatar Phil Krylov Committed by Alexandre Julliard

riched20: Selection painting fixes.

parent 0844b702
......@@ -759,8 +759,8 @@ void ME_MouseMove(ME_TextEditor *editor, int x, int y)
return;
HideCaret(editor->hWnd);
ME_InvalidateSelection(editor);
ME_MoveCaret(editor);
ME_Repaint(editor);
ShowCaret(editor->hWnd);
ME_SendSelChange(editor);
}
......@@ -1185,6 +1185,7 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl)
editor->pCursors[1] = tmp_curs;
*p = tmp_curs;
if (ME_IsSelection(editor))
ME_InvalidateSelection(editor);
HideCaret(editor->hWnd);
ME_EnsureVisible(editor, tmp_curs.pRun);
......
......@@ -1278,8 +1278,9 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
return 0;
case EM_SETSEL:
{
ME_InvalidateSelection(editor);
ME_SetSelection(editor, wParam, lParam);
ME_Repaint(editor);
ME_InvalidateSelection(editor);
ME_SendSelChange(editor);
return 0;
}
......@@ -1287,9 +1288,9 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
{
CHARRANGE *pRange = (CHARRANGE *)lParam;
TRACE("EM_EXSETSEL (%ld,%ld)\n", pRange->cpMin, pRange->cpMax);
ME_InvalidateSelection(editor);
ME_SetSelection(editor, pRange->cpMin, pRange->cpMax);
/* FIXME optimize */
ME_Repaint(editor);
ME_InvalidateSelection(editor);
ME_SendSelChange(editor);
return 0;
}
......@@ -1365,7 +1366,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
else
nStyle &= ~ES_READONLY;
SetWindowLongW(hWnd, GWL_STYLE, nStyle);
ME_Repaint(editor);
return 0;
}
case EM_SETEVENTMASK:
......
......@@ -143,13 +143,13 @@ void ME_Repaint(ME_TextEditor *editor)
{
ME_Cursor *pCursor = &editor->pCursors[0];
ME_MarkSelectionForRepaint(editor);
if (ME_WrapMarkedParagraphs(editor)) {
ME_UpdateScrollBar(editor);
}
if (editor->bRedraw)
{
ME_EnsureVisible(editor, pCursor->pRun);
UpdateWindow(editor->hWnd);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment