X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0f1fbeb81044f54fbf5b1c2cbfd9152da1862e90..092d7f88f6819e52dd8ea69d66e474571e527eba:/src/richtext/richtextbuffer.cpp diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index bbdebd1b79..4ac92a5b52 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -3921,9 +3921,11 @@ bool wxRichTextParagraph::FindWrapPosition(const wxRichTextRange& range, wxDC& d else { int spacePos = plainText.Find(wxT(' '), true); - if (spacePos != wxNOT_FOUND) + int tabPos = plainText.Find(wxT('\t'), true); + int pos = wxMax(spacePos, tabPos); + if (pos != wxNOT_FOUND) { - int positionsFromEndOfString = plainText.length() - spacePos - 1; + int positionsFromEndOfString = plainText.length() - pos - 1; breakPosition = breakPosition - positionsFromEndOfString; } }