From 6f9f01f28f7a191d3f62b9f72e6afe787aeb0c43 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Mon, 23 Jun 2008 17:09:58 -0400 Subject: [PATCH] richedit: bCaretAtEnd should not be reset from rewrapping text. The bCaretAtEnd value in ME_TextEditor is used to identify that the caret is at the end of a wrapped line instead of the start of the next line in the paragraph since both these positions correspond to the same position in the document. The bCaretAtEnd value was previously being set back to FALSE whenever the window was resized. --- dlls/riched20/caret.c | 4 ---- dlls/riched20/run.c | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 0ae034c1a16..02c375cd882 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -164,7 +164,6 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, ME_DisplayItem *pCursorRun = pCursor->pRun; ME_DisplayItem *pSizeRun = pCursor->pRun; - assert(!pCursor->nOffset || !editor->bCaretAtEnd); assert(height && x && y); assert(!(ME_GetParagraph(pCursorRun)->member.para.nFlags & MEPF_REWRAP)); assert(pCursor->pRun); @@ -1179,9 +1178,6 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor) static void ME_ArrowHome(ME_TextEditor *editor, ME_Cursor *pCursor) { ME_DisplayItem *pRow = ME_FindItemBack(pCursor->pRun, diStartRow); - /* bCaretAtEnd doesn't make sense if the cursor isn't set at the - first character of the next row */ - assert(!editor->bCaretAtEnd || !pCursor->nOffset); ME_WrapMarkedParagraphs(editor); if (pRow) { ME_DisplayItem *pRun; diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index 0af3ba08012..805975c75f4 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -241,11 +241,7 @@ void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p) assert(p->member.run.nCharOfs != -1); ME_GetParagraph(p)->member.para.nFlags |= MEPF_REWRAP; - /* if we were at the end of screen line, and the next run is in the new - * line, then it's not the end of the line anymore */ - if (editor->bCaretAtEnd && editor->pCursors[0].pRun == pNext) - editor->bCaretAtEnd = FALSE; - /* Update all cursors so that they don't contain the soon deleted run */ + /* Update all cursors so that they don't contain the soon deleted run */ for (i=0; inCursors; i++) { if (editor->pCursors[i].pRun == pNext) { editor->pCursors[i].pRun = p; -- 2.11.4.GIT