Skip to content
Snippets Groups Projects
Commit f45408b2 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard
Browse files

riched20: Use row helpers for Home/End key handling.

parent aaf29c79
No related branches found
No related tags found
No related merge requests found
......@@ -1375,19 +1375,11 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor)
assert(pCursor->pRun->type == diRun);
}
static void ME_ArrowHome(ME_TextEditor *editor, ME_Cursor *pCursor)
static void ME_ArrowHome( ME_TextEditor *editor, ME_Cursor *cursor )
{
ME_DisplayItem *pRow = ME_FindItemBack(pCursor->pRun, diStartRow);
if (pRow) {
ME_DisplayItem *pRun;
pRun = ME_FindItemFwd(pRow, diRun);
if (pRun) {
pCursor->pRun = pRun;
assert(pCursor->pPara == ME_GetParagraph(pRun));
pCursor->nOffset = 0;
}
}
ME_Row *row = row_from_cursor( cursor );
row_first_cursor( row, cursor );
}
static void ME_ArrowCtrlHome(ME_TextEditor *editor, ME_Cursor *pCursor)
......@@ -1395,14 +1387,11 @@ static void ME_ArrowCtrlHome(ME_TextEditor *editor, ME_Cursor *pCursor)
ME_SetCursorToStart(editor, pCursor);
}
static void ME_ArrowEnd(ME_TextEditor *editor, ME_Cursor *pCursor)
static void ME_ArrowEnd( ME_TextEditor *editor, ME_Cursor *cursor )
{
ME_DisplayItem *pRow;
ME_Row *row = row_from_cursor( cursor );
pRow = ME_FindItemFwd(pCursor->pRun, diStartRowOrParagraphOrEnd);
assert(pRow);
pCursor->pRun = ME_FindItemBack(pRow, diRun);
pCursor->nOffset = (pRow->type == diStartRow) ? pCursor->pRun->member.run.len : 0;
row_end_cursor( row, cursor, FALSE );
}
static void ME_ArrowCtrlEnd(ME_TextEditor *editor, ME_Cursor *pCursor)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment