diff --git a/docs/changes.txt b/docs/changes.txt index 8cdf875535..448a54c66c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -668,6 +668,7 @@ All (GUI): - Add more convenient wxFont(wxFontInfo) ctor. - Pass menu events to the handler in the associated wxMenuBar. - Add wxWindow::BeginRepositioningChildren() and EndRepositioningChildren(). +- Fix wxStyledTextCtrl::SetInsertionPointEnd() (troelsk). wxGTK: diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 1edf28158e..c406e6a687 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -4577,7 +4577,10 @@ public: */ - virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); } + virtual void SetInsertionPoint(long pos) + { + SetCurrentPos(pos == -1 ? GetLastPosition() : pos); + } virtual long GetInsertionPoint() const { return GetCurrentPos(); } virtual long GetLastPosition() const { return GetTextLength(); } diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 1c980ab3cc..b82bea900c 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -319,7 +319,10 @@ public: */ - virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); } + virtual void SetInsertionPoint(long pos) + { + SetCurrentPos(pos == -1 ? GetLastPosition() : pos); + } virtual long GetInsertionPoint() const { return GetCurrentPos(); } virtual long GetLastPosition() const { return GetTextLength(); }