From 65677488516842a932ecb48a7483c57a1d4673cb Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 23 Aug 2013 14:24:14 +1000 Subject: [PATCH] Hack to improve view of ignore-blank conflicts. cd tests/contrib/abstract ../../../wiggle -Bb orig new new2 select the "central" and type 'x' so it disappears and note that the only remaining difference is that "computational" has been deleted. Without this patch you only see one '-' line and no '+' line. However the result isn't perfect as ./wiggle -Bp demo.patch visit the README file page down to waht "You can use 'o' ..." as added. And note that there is a '-' blank line and a '+' blank line. These are unwanted and added by this patch. Signed-off-by: NeilBrown --- vpatch.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vpatch.c b/vpatch.c index 1328d56..44043ef 100644 --- a/vpatch.c +++ b/vpatch.c @@ -633,6 +633,15 @@ static int check_line(struct mpos pos, struct file fm, struct file fb, } while (e.start != NULL && (!ends_line(e) || visible(mode, m, &pos) == -1)); + /* This is a bit of a hack... If the end-of-line just + * before this line was changed, then quite possibly this + * line is part of a change too. This is particularly important + * when --ignore-blanks is in effect as newlines are not separate + * from other words. It could be that this test needs to be + * strengthened when I have examined more cases. + */ + if (e.start && m[pos.p.m].oldtype == Changed) + rv |= CHANGES; if (unmatched && (rv & CHANGES)) rv |= WIGGLED; -- 2.39.5