Commit 7f9757c7 authored by Behdad Esfahbod's avatar Behdad Esfahbod
Browse files

Add _vte_ring_set_length

parent 9a3de3c2
......@@ -78,10 +78,11 @@ struct _VteRing {
(((__position) >= (__ring)->delta) && \
((__position) < (__ring)->delta + (__ring)->length))
#define _vte_ring_delta(__ring) ((__ring)->delta + 0)
#define _vte_ring_length(__ring) ((__ring)->length /* + 0 XXX */)
#define _vte_ring_length(__ring) ((__ring)->length + 0)
#define _vte_ring_next(__ring) ((__ring)->delta + (__ring)->length)
#define _vte_ring_max(__ring) ((__ring)->max + 0)
#define _vte_ring_index(__ring, __position) (&(__ring)->array[(__position) % (__ring)->max])
#define _vte_ring_set_length(__ring, __length) ((__ring)->length = __length)
VteRing *_vte_ring_new(glong max_elements);
void _vte_ring_resize(VteRing *ring, glong max_elements);
......
......@@ -13087,14 +13087,14 @@ vte_terminal_set_scrollback_lines(VteTerminal *terminal, glong lines)
scroll_delta = CLAMP (scroll_delta, low, screen->insert_delta);
next = MIN (next, screen->insert_delta + terminal->row_count);
if (_vte_ring_next (screen->row_data) > next){
_vte_ring_length (screen->row_data) = next - low;
_vte_ring_set_length (screen->row_data, next - low);
}
} else {
_vte_ring_resize (screen->row_data, terminal->row_count);
scroll_delta = _vte_ring_delta (screen->row_data);
screen->insert_delta = _vte_ring_delta (screen->row_data);
if (_vte_ring_next (screen->row_data) > screen->insert_delta + terminal->row_count){
_vte_ring_length (screen->row_data) = terminal->row_count;
_vte_ring_set_length (screen->row_data, terminal->row_count);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment