diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 3d7a97adb4..721db6b872 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -2208,7 +2208,7 @@ bool wxRichTextCtrl::MoveToParagraphStart(int flags) if (!extendSel) SelectNone(); - SetCaretPosition(newPos); + SetCaretPosition(newPos, true); PositionCaret(); SetDefaultStyleToCursorStyle(); @@ -3174,6 +3174,7 @@ void wxRichTextCtrl::SetInsertionPoint(long pos) SelectNone(); m_caretPosition = pos - 1; + m_caretAtLineStart = true; PositionCaret(); diff --git a/tests/controls/richtextctrltest.cpp b/tests/controls/richtextctrltest.cpp index 087a07b5c6..f3813de3c5 100644 --- a/tests/controls/richtextctrltest.cpp +++ b/tests/controls/richtextctrltest.cpp @@ -350,7 +350,7 @@ void RichTextCtrlTestCase::CaretPosition() m_rich->AddParagraph("This is paragraph one"); m_rich->AddParagraph("Paragraph two\n has \nlots of\n lines"); - m_rich->MoveCaret(1); + m_rich->SetInsertionPoint(2); CPPUNIT_ASSERT_EQUAL(1, m_rich->GetCaretPosition());