]> git.neil.brown.name Git - wiggle.git/commitdiff
Hack to improve view of ignore-blank conflicts.
authorNeilBrown <neilb@suse.de>
Fri, 23 Aug 2013 04:24:14 +0000 (14:24 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 23 Aug 2013 04:24:14 +0000 (14:24 +1000)
  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 <neilb@suse.de>
vpatch.c

index 1328d5699585ee6a613c2522789aee238937d042..44043ef340af584a59c2ed4b30ff8e433b82e7ab 100644 (file)
--- 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;