From a9ad1e1b0ad5424df3a82cddfbd2e4006063318e Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 30 May 2010 14:00:23 +0000 Subject: [PATCH] Caret position corrected to end of selection git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@64433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextctrl.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 1eb6d41367..4d14b28ab6 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -2606,8 +2606,7 @@ void wxRichTextCtrl::DoSetSelection(long from, long to, bool WXUNUSED(scrollCare m_selectionAnchor = from-1; m_selectionRange.SetRange(from, to-1); - // Have to subtract 2, one because of endPos+1 rule (SetSelection docs) and another to turn into caret position. - m_caretPosition = wxMax(-1, to-2); + m_caretPosition = wxMax(-1, to-1); wxRichTextCtrlRefreshForSelectionChange(*this, oldSelection, m_selectionRange); PositionCaret();