X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7b377ed9b65b7554471e7347aa09960c77e35c15..bc5443ba0701dd68eac6f987319ece2b7faba33d:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 90d8220629..1a1985f805 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1139,8 +1139,12 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const { GtkTextIter line; gtk_text_buffer_get_iter_at_line(m_buffer,&line,lineNo); + GtkTextIter end = line; - gtk_text_iter_forward_to_line_end(&end); + // avoid skipping to the next line end if this one is empty + if ( !gtk_text_iter_ends_line(&line) ) + gtk_text_iter_forward_to_line_end(&end); + wxGtkString text(gtk_text_buffer_get_text(m_buffer, &line, &end, true)); result = wxGTK_CONV_BACK(text); }