Commit f9bd64bb authored by Christian Hergert's avatar Christian Hergert
Browse files

source-view: special case end-of-file with smart backspace

If we are at the end of the file, we will have a gunichar of zero. Handle
this specially, since it's okay to continue to walk backwards.
parent 7b3308b9
......@@ -2104,10 +2104,18 @@ ide_source_view_do_smart_backspace (IdeSourceView *self,
/* if the line isn't empty up to our cursor, ignore */
tmp = insert;
while (!gtk_text_iter_starts_line (&tmp))
while (TRUE)
{
if (!g_unichar_isspace (gtk_text_iter_get_char (&tmp)))
gunichar ch;
ch = gtk_text_iter_get_char (&tmp);
if ((ch != 0) && !g_unichar_isspace (ch))
IDE_RETURN (FALSE);
if (gtk_text_iter_starts_line (&tmp))
break;
gtk_text_iter_backward_char (&tmp);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment