comparison mcabber/src/hbuf.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 b5aa2b9c425a
children c289e3c39c48
comparison
equal deleted inserted replaced
188:7604e3cdbb86 189:4f3975f1b852
215 curr_elt = g_list_next(curr_elt); 215 curr_elt = g_list_next(curr_elt);
216 } 216 }
217 } 217 }
218 } 218 }
219 219
220 // hbuf_previous_persistent()
221 // Returns the previous persistent block (line). If the given line is
222 // persistent, then it is returned.
223 // This function is used for example when resizing a buffer. If the top of the
224 // screen is on a non-persistent block, then a screen resize could destroy this
225 // line...
226 GList *hbuf_previous_persistent(GList *l_line)
227 {
228 hbuf_block *hbuf_b_elt;
229
230 while (l_line) {
231 hbuf_b_elt = (hbuf_block*)l_line->data;
232 if (hbuf_b_elt->flags & HBB_FLAG_PERSISTENT)
233 return l_line;
234 l_line = g_list_previous(l_line);
235 }
236
237 return NULL;
238 }
239
220 // hbuf_get_lines(hbuf, n, where) FIXME bad comments XXX 240 // hbuf_get_lines(hbuf, n, where) FIXME bad comments XXX
221 // Returns an array of 2*n pointers (for n prefixes + n lines from hbuf) 241 // Returns an array of 2*n pointers (for n prefixes + n lines from hbuf)
222 // (prefix line 1, line 1, prefix line 2, line 2, etc.) 242 // (prefix line 1, line 1, prefix line 2, line 2, etc.)
223 // (The first line will be the line currently pointed by hbuf) 243 // (The first line will be the line currently pointed by hbuf)
224 // Note:The caller should free the array after use. 244 // Note:The caller should free the array after use.