]> git.neil.brown.name Git - wiggle.git/commitdiff
Browse: ensure we erase all of old type name when updating position data.
authorNeilBrown <neilb@suse.de>
Sun, 11 Nov 2012 22:25:12 +0000 (09:25 +1100)
committerNeilBrown <neilb@suse.de>
Sun, 11 Nov 2012 22:25:12 +0000 (09:25 +1100)
Top-right of the merge window identifies the current location in
the merge.  It is variable length and right justified, so we need to make
sure we erase start of old value before writing new value.
Old code only allowed for a difference of three which didn't cope
with, for example, change from AlreadyApplied to Changed.
So be more thorough.

Signed-off-by: NeilBrown <neilb@suse.de>
vpatch.c

index 280ad61f3a2b004eb88545e57daad5b49b34685a..fa3a3f3da678917549b2decb459720eddaaa518b 100644 (file)
--- a/vpatch.c
+++ b/vpatch.c
@@ -1463,7 +1463,11 @@ static void merge_window(struct plist *p, FILE *f, int reverse)
                        snprintf(lbuf, 29, "%s ln:%d",
                                 typenames[ci.merger[curs.pos.m].type],
                                 (pos.p.lineno-1)/2);
-                       mvaddstr(0, cols - strlen(lbuf) - 4, "       ");
+                       /* Longest type is AlreadyApplied - need to ensure
+                        * we erase all of that.
+                        */
+                       move(0, cols - strlen(lbuf) - 14);
+                       clrtoeol();
                        mvaddstr(0, cols - strlen(lbuf) - 1, lbuf);
                }
 #define META(c) ((c)|0x1000)