GNOME Bugzilla – Bug 337022
mixed line separators confuse gtk_text_iter_ends_line
Last modified: 2006-04-05 18:33:53 UTC
This is a follow up bug of bug #336915 because I want to track other gedit/gtksourceview issues there. Marking as critical because it causes gedit crashes. consider the following text: 1 foo\r 2 bar\n 3 baz 4 ... place the cursor after 'bar' and hit delete 'bar' by pressing backspace 3 times. 1 foo\r 2 \n 3 baz 4 ... \r and \n are two separate line terminators and should not be treated as a single \r\n terminator. One of the problems of the current behavior is that using gtk_text_iter_forward_to_line_end on the second line causes the iterator to go back to the first line, which is unexpected and is the causes of crashes in gedit/gtksourceview.
Created attachment 62664 [details] [review] patch This patch fixes the described issue, however it must be thought carefully if it could cause other unexpected side effects.
Created attachment 62665 [details] [review] unit test here is a simple test program.
committed after discussing with Matthias on irc.