]> git.neil.brown.name Git - wiggle.git/commitdiff
vpatch: change appearance of ignored conflicts.
authorNeilBrown <neilb@suse.de>
Wed, 14 Nov 2012 23:43:26 +0000 (10:43 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 14 Nov 2012 23:53:41 +0000 (10:53 +1100)
I'm not sure about this yet, but ignored conflicts should look
a bit different to normal ones, so remove some of the highlight.

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

index 709e173e5c97d0b3c6bcefe537603cd8f6206477..99ec97e04e8ab205f6a9090b50d6ec4f04a34a13 100644 (file)
--- a/vpatch.c
+++ b/vpatch.c
@@ -510,6 +510,7 @@ static int visible(int mode, struct merge *m, struct mpos *pos)
 {
        enum mergetype type = m[pos->p.m].type;
        int stream = pos->p.s;
+       unsigned int ignore;
 
        if (mode == 0)
                return -1;
@@ -539,20 +540,24 @@ static int visible(int mode, struct merge *m, struct mpos *pos)
                        return a_added;
                break;
        case Conflict:
+               if (m[pos->p.m].conflict_ignored)
+                       ignore = A_REVERSE|A_UNDERLINE;
+               else
+                       ignore = 0;
                switch (stream) {
                case 0:
                        if (mode & ORIG)
-                               return a_unmatched | A_REVERSE;
+                               return a_unmatched | (A_REVERSE & ~ignore);
                        break;
                case 1:
                        if (mode & BEFORE)
-                               return a_extra | A_UNDERLINE;
+                               return a_extra | (A_UNDERLINE & ~ignore);
                        break;
                case 2:
                        if ((mode & RESULT) && m[pos->p.m].conflict_ignored)
                                break;
                        if (mode & (AFTER|RESULT))
-                               return a_added | A_UNDERLINE;
+                               return a_added | (A_UNDERLINE & ~ignore);
                        break;
                }
                break;
@@ -1560,7 +1565,9 @@ static int merge_window(struct plist *p, FILE *f, int reverse)
                {
                        char lbuf[30];
                        (void)attrset(A_BOLD);
-                       snprintf(lbuf, 29, "%s ln:%d",
+                       snprintf(lbuf, 29, "%s%s ln:%d",
+                                ci.merger[curs.pos.m].conflict_ignored
+                                ? "Ignored ":"",
                                 typenames[ci.merger[curs.pos.m].type],
                                 (pos.p.lineno-1)/2);
                        /* Longest type is AlreadyApplied - need to ensure