From 084ce55b3e895788c7139a508e9b20aac524f547 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 12 Nov 2012 09:25:12 +1100 Subject: [PATCH] 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 --- vpatch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.39.5