From 04cf925a3116beb072c998b0cd3f105dedbab34e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 18 Mar 2019 23:13:29 +0100 Subject: Fix Pango warning when moving cursor off the end of blank narrative paragraph --- libstorycode/gtk/gtknarrativeview.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libstorycode') diff --git a/libstorycode/gtk/gtknarrativeview.c b/libstorycode/gtk/gtknarrativeview.c index 226ce93..5bf45dd 100644 --- a/libstorycode/gtk/gtknarrativeview.c +++ b/libstorycode/gtk/gtknarrativeview.c @@ -679,6 +679,7 @@ static void cursor_moveh(Narrative *n, struct edit_pos *cp, signed int dir) { struct narrative_item *item = &n->items[cp->para]; int np = cp->pos; + int otrail = cp->trail; if ( item->type == NARRATIVE_ITEM_SLIDE ) { if ( dir > 0 ) { @@ -722,8 +723,8 @@ static void cursor_moveh(Narrative *n, struct edit_pos *cp, signed int dir) cp->trail = 0; return; } else { - /* Can't move any further */ - cp->trail = 1; + /* Can't move any further, undo change to cp->trail */ + cp->trail = otrail; return; } } -- cgit v1.2.3