diff options
author | Thomas White <taw@bitwiz.me.uk> | 2019-03-18 23:13:29 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2019-03-18 23:13:29 +0100 |
commit | 04cf925a3116beb072c998b0cd3f105dedbab34e (patch) | |
tree | 1b35301b953c82199abc742adbba1c200766d3ba /libstorycode | |
parent | 38ae27615c04bebd19626986d5e85d3359a3a938 (diff) |
Fix Pango warning when moving cursor off the end of blank narrative paragraph
Diffstat (limited to 'libstorycode')
-rw-r--r-- | libstorycode/gtk/gtknarrativeview.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } } |