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.
This commit is contained in:
Dylan Smith 2008-06-23 17:09:58 -04:00 committed by Alexandre Julliard
parent c8e2552ad9
commit 6f9f01f28f
2 changed files with 1 additions and 9 deletions

View File

@ -164,7 +164,6 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor,
ME_DisplayItem *pCursorRun = pCursor->pRun; ME_DisplayItem *pCursorRun = pCursor->pRun;
ME_DisplayItem *pSizeRun = pCursor->pRun; ME_DisplayItem *pSizeRun = pCursor->pRun;
assert(!pCursor->nOffset || !editor->bCaretAtEnd);
assert(height && x && y); assert(height && x && y);
assert(!(ME_GetParagraph(pCursorRun)->member.para.nFlags & MEPF_REWRAP)); assert(!(ME_GetParagraph(pCursorRun)->member.para.nFlags & MEPF_REWRAP));
assert(pCursor->pRun); 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) static void ME_ArrowHome(ME_TextEditor *editor, ME_Cursor *pCursor)
{ {
ME_DisplayItem *pRow = ME_FindItemBack(pCursor->pRun, diStartRow); 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); ME_WrapMarkedParagraphs(editor);
if (pRow) { if (pRow) {
ME_DisplayItem *pRun; ME_DisplayItem *pRun;

View File

@ -241,11 +241,7 @@ void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p)
assert(p->member.run.nCharOfs != -1); assert(p->member.run.nCharOfs != -1);
ME_GetParagraph(p)->member.para.nFlags |= MEPF_REWRAP; 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 /* Update all cursors so that they don't contain the soon deleted run */
* 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 */
for (i=0; i<editor->nCursors; i++) { for (i=0; i<editor->nCursors; i++) {
if (editor->pCursors[i].pRun == pNext) { if (editor->pCursors[i].pRun == pNext) {
editor->pCursors[i].pRun = p; editor->pCursors[i].pRun = p;