diff mcabber/src/screen.c @ 189:4f3975f1b852

[/trunk] Changeset 201 by mikael * Add hbuf_previous_persistent(). Now we should not jump to the buffer's bottom when increasing the screen width.
author mikael
date Fri, 06 May 2005 14:34:51 +0000
parents 4ce9ff808baa
children 9c2023d60986
line wrap: on
line diff
--- a/mcabber/src/screen.c	Fri May 06 09:58:44 2005 +0000
+++ b/mcabber/src/screen.c	Fri May 06 14:34:51 2005 +0000
@@ -533,6 +533,7 @@
   list_for_each_safe(pos, n, &window_list) {
     search_entry = window_entry(pos);
     if (search_entry->win) {
+      GList *rescue_top;
       // Resize buddy window (no need to move it)
       wresize(search_entry->win, lines, cols);
       werase(search_entry->win);
@@ -541,8 +542,11 @@
         replace_panel(search_entry->panel, search_entry->win);
       }
       // Redo line wrapping
+      rescue_top = hbuf_previous_persistent(search_entry->top);
       hbuf_rebuild(&search_entry->hbuf,
               maxX - ROSTER_WIDTH - PREFIX_WIDTH);
+      if (g_list_position(g_list_first(search_entry->hbuf), search_entry->top) == -1)
+        search_entry->top = rescue_top;
     }
   }