diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-07-29 10:38:45 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-07-29 10:38:45 +0200 |
commit | 7d25b6266516c8b89e86411006f35bb34b82159a (patch) | |
tree | d8bc185ff3b2aa50fae167911d8c6a5a3874124a | |
parent | ffdba5b2488995dd81ee3ba608421ab470d3b33e (diff) | |
download | weechat-7d25b6266516c8b89e86411006f35bb34b82159a.zip |
Fix hotlist bug after /buffer unmerge (bug #27133)
-rw-r--r-- | src/gui/gui-buffer.c | 30 | ||||
-rw-r--r-- | src/gui/gui-line.c | 4 |
2 files changed, 31 insertions, 3 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 719ad43f2..a85e7d944 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1123,6 +1123,30 @@ gui_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property, } /* + * gui_buffer_compute_num_displayed: compute "num_displayed" for all buffers + */ + +void +gui_buffer_compute_num_displayed () +{ + struct t_gui_buffer *ptr_buffer; + struct t_gui_window *ptr_window; + + for (ptr_buffer = gui_buffers; ptr_buffer; + ptr_buffer = ptr_buffer->next_buffer) + { + ptr_buffer->num_displayed = 0; + } + + for (ptr_window = gui_windows; ptr_window; + ptr_window = ptr_window->next_window) + { + if (ptr_window->buffer) + ptr_window->buffer->num_displayed++; + } +} + +/* * gui_buffer_add_value_num_displayed: add value to "num_displayed" variable * for a buffer (value can be negative) */ @@ -1449,7 +1473,7 @@ gui_buffer_close (struct t_gui_buffer *buffer) { (void)(buffer->close_callback) (buffer->close_callback_data, buffer); } - + /* first unmerge buffer if it is merged to at least one other buffer */ if (gui_buffer_count_merged_buffers (buffer->number) > 1) gui_buffer_unmerge (buffer, -1); @@ -1839,6 +1863,8 @@ gui_buffer_merge (struct t_gui_buffer *buffer, ptr_buffer->number--; } + gui_buffer_compute_num_displayed (); + gui_window_ask_refresh (1); hook_signal_send ("buffer_merged", @@ -1949,6 +1975,8 @@ gui_buffer_unmerge (struct t_gui_buffer *buffer, int number) ptr_buffer->number++; } + gui_buffer_compute_num_displayed (); + gui_window_ask_refresh (1); hook_signal_send ("buffer_unmerged", diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index 7f155cf5a..c6486a10f 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -1067,8 +1067,8 @@ gui_lines_print_log (struct t_gui_lines *lines) log_printf (" first_line . . . . . : 0x%lx", lines->first_line); log_printf (" last_line. . . . . . : 0x%lx", lines->last_line); log_printf (" last_read_line . . . : 0x%lx", lines->last_read_line); - log_printf (" lines_count. . . . . . : %d", lines->lines_count); - log_printf (" first_line_not_read. . : %d", lines->first_line_not_read); + log_printf (" lines_count. . . . . : %d", lines->lines_count); + log_printf (" first_line_not_read. : %d", lines->first_line_not_read); log_printf (" lines_hidden . . . . : %d", lines->lines_hidden); log_printf (" buffer_max_length. . : %d", lines->buffer_max_length); log_printf (" prefix_max_length. . : %d", lines->prefix_max_length); |