From: NeilBrown Date: Sun, 11 Nov 2012 22:25:12 +0000 (+1100) Subject: Browse: ensure we erase all of old type name when updating position data. X-Git-Tag: v1.0~106 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=084ce55b3e895788c7139a508e9b20aac524f547;p=wiggle.git Browse: ensure we erase all of old type name when updating position data. 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 --- diff --git a/vpatch.c b/vpatch.c index 280ad61..fa3a3f3 100644 --- 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)