diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-02 13:53:38 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-02 13:53:38 +0100 |
commit | 323290c83ef58904bf08d2447a20ab55659f778b (patch) | |
tree | b927c8af5453af013cc3f073eb64b9f431a5380c /src/gui/gui-chat.c | |
parent | 7e12f8596a501323c8e9f889ed1c2f4080e8cd0e (diff) | |
download | weechat-323290c83ef58904bf08d2447a20ab55659f778b.zip |
Fix crash when read marker is moved before first line displayed (when first line of buffer is removed)
Diffstat (limited to 'src/gui/gui-chat.c')
-rw-r--r-- | src/gui/gui-chat.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index 2e0b7c40d..87249999a 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -692,6 +692,14 @@ gui_chat_line_free (struct t_gui_buffer *buffer, struct t_gui_line *line) } } + /* move read marker if it was on line we are removing */ + if (buffer->last_read_line == line) + { + buffer->last_read_line = buffer->last_read_line->prev_line; + buffer->first_line_not_read = (buffer->last_read_line) ? 0 : 1; + gui_buffer_ask_chat_refresh (buffer, 1); + } + /* free data */ if (line->str_time) free (line->str_time); |