diff options
author | Owen Taylor <otaylor@src.gnome.org> | 2004-10-22 17:30:43 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-10-22 17:30:43 +0000 |
commit | ad955c8196da560c6a0b10e6abbc8ce8468deb5d (patch) | |
tree | 260d9afad35959507bf4f84c4c735723eb26c842 /gtk/gtktextbuffer.c | |
parent | 81229a1b0b113bd8977aa882e6876f8684adaab6 (diff) | |
download | gtk+-ad955c8196da560c6a0b10e6abbc8ce8468deb5d.tar.gz |
ri Oct 22 13:25:25 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_backspace): Fix
backspacing on the empty last line of a buffer
(https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=136840,
Dan Williams)
Diffstat (limited to 'gtk/gtktextbuffer.c')
-rw-r--r-- | gtk/gtktextbuffer.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index 814cf8057d..8d822ad356 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -3423,8 +3423,17 @@ gtk_text_buffer_backspace (GtkTextBuffer *buffer, end = *iter; attrs = _gtk_text_buffer_get_line_log_attrs (buffer, &start, NULL); - offset = gtk_text_iter_get_line_offset (&start); - backspace_deletes_character = attrs[offset].backspace_deletes_character; + + /* For no good reason, attrs is NULL for the empty last line in + * a buffer. Special case that here. (#156164) + */ + if (attrs) + { + offset = gtk_text_iter_get_line_offset (&start); + backspace_deletes_character = attrs[offset].backspace_deletes_character; + } + else + backspace_deletes_character = FALSE; gtk_text_iter_backward_cursor_position (&start); |