GNOME Bugzilla – Bug 771373
Fix gtk_source_buffer_sort_lines()
Last modified: 2016-09-30 12:30:56 UTC
It does not behave correctly when called where the start iter and end iter are on the same line. Also when the start iter is not at the beginning of a line!
Created attachment 335450 [details] [review] Fix gtk_source_buffer_sort_lines() The start iterator needs to be moved to the start of the line for gtk_text_iter_delete(). Also, return early if the start and end iter are on the same line.
Review of attachment 335450 [details] [review]: Looks good, apart for the comment below. Remember that we are currently in hard code freeze. It's better to wait 3.22.1 to apply the patch. ::: gtksourceview/gtksourcebuffer.c @@ +2958,3 @@ } + if (start_line == end_line) It's better to call gtk_text_iter_equal(). I don't think the GtkTextView API guarantees that the two struct instances will be the same (it's an opaque data type).
Review of attachment 335450 [details] [review]: Ah, no, sorry for the mistake, I thought the comparison was between two GtkTextIters, but it's the lines.
Is this now safe to push?
Yes. You can also backport on gnome-3-22.
Pushed as commit c9c72a5cfa8609caa38456bc28c7717252f18599 and backported on gnome-3-22.