From: NeilBrown Date: Wed, 14 Nov 2012 23:07:19 +0000 (+1100) Subject: vpatch: update display correctly when editing the merge. X-Git-Tag: v1.0~86 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=83ccb6192031a3fb4bec84611c53ced83a1a27ad;p=wiggle.git vpatch: update display correctly when editing the merge. If an edit changes the merge so that we don't need to show two separate streams any more, then the display must be updated to not show the stream. And the reverse. Signed-off-by: NeilBrown --- diff --git a/vpatch.c b/vpatch.c index eeb4666..97f8f95 100644 --- a/vpatch.c +++ b/vpatch.c @@ -1452,6 +1452,14 @@ static int merge_window(struct plist *p, FILE *f, int reverse) vispos = pos; /* visible position - if cursor is in * alternate pane, pos might not be visible * in main pane. */ + if (check_line(vispos, fm, fb, fa, ci.merger, mode) + & CHANGES) { + if (vispos.state == 0) + vispos.state = 1; + } else { + vispos.state = 0; + } + if (visible(mode, ci.merger, &vispos) < 0) prev_mline(&vispos, fm, fb, fa, ci.merger, mode); @@ -1507,6 +1515,13 @@ static int merge_window(struct plist *p, FILE *f, int reverse) struct mpos spos = pos; int smode = BEFORE|AFTER; int srow = (rows + splitrow)/2; + if (check_line(spos, fm, fb, fa, ci.merger, smode) + & CHANGES) { + if (spos.state == 0) + spos.state = 1; + } else { + spos.state = 0; + } if (visible(smode, ci.merger, &spos) < 0) prev_mline(&spos, fm, fb, fa, ci.merger, smode); /* Now hi/lo might be wrong, so lets fix it. */