diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 5750db9..ce8e36e 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -252,18 +252,16 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, } -void -ME_MoveCaret(ME_TextEditor *editor) +void ME_MoveCaret(ME_TextEditor *editor) { int x, y, height; + if (!editor->bHaveFocus || ME_IsSelection(editor)) + return; ME_GetCursorCoordinates(editor, &editor->pCursors[0], &x, &y, &height); - if(editor->bHaveFocus && !ME_IsSelection(editor)) - { - x = min(x, editor->rcFormat.right-1); - ITextHost_TxCreateCaret(editor->texthost, NULL, 0, height); - ITextHost_TxSetCaretPos(editor->texthost, x, y); - } + x = min(x, editor->rcFormat.right - 1); + ITextHost_TxCreateCaret(editor->texthost, NULL, 0, height); + ITextHost_TxSetCaretPos(editor->texthost, x, y); }