From 2c90cac08fb74e910a4833b01baee3d5db792f73 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 3 Sep 2017 22:14:44 +0200 Subject: debugger: Avoid problems when a run gets deleted --- src/debugger.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/debugger.c b/src/debugger.c index 531969c..32cea14 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -207,6 +207,7 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr, struct debugwindow *dbgw) double ypos = 10.0; int dpos = 0; int changesig = 0; + int npr = 10; /* Not zero */ /* Background */ width = gtk_widget_get_allocated_width(GTK_WIDGET(da)); @@ -229,6 +230,10 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr, struct debugwindow *dbgw) enum para_type t = para_type(dbgw->fr->paras[i]); + /* Jump the "old values" pointer forward to the next paragraph start */ + while ( dbgw->runs[dpos].np == npr ) dpos++; + npr = dbgw->runs[dpos].np; + plot_hr(cr, &ypos, width); snprintf(tmp, 255, "Paragraph %i: type %s", i, str_type(t)); plot_text(cr, &ypos, fontdesc, tmp); -- cgit v1.2.3