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:
parent
c8e2552ad9
commit
6f9f01f28f
|
@ -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;
|
||||
|
|
|
@ -241,10 +241,6 @@ 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 */
|
||||
for (i=0; i<editor->nCursors; i++) {
|
||||
if (editor->pCursors[i].pRun == pNext) {
|
||||
|
|
Loading…
Reference in New Issue