const char *attr safe, int which)
{
struct merge *m;
+ int mergenum;
int pos = 0;
if (!f.list || !st)
st = mark_dup(st);
doskip(p, st, NULL, skip, choose);
- for (m = merge; m->type != End; m++) {
+ for (m = merge, mergenum=0; m->type != End; m++, mergenum++) {
int len;
const char *cp, *endcp;
wint_t wch;
bool non_space;
int chars;
char *suffix = "";
- char buf[30];
+ char buf[128];
switch (which) {
case 0: /* orig - no Extraneous */
if (m->type == Conflict && !non_space)
suffix = " spaces";
- snprintf(buf, sizeof(buf), "%d %s%s",
- chars, typenames[m->type], suffix);
+ snprintf(buf, sizeof(buf), "M %d %s %d%s",
+ chars, typenames[m->type], mergenum, suffix);
call("doc:set-attr", p, 0, st, attr, 0, NULL, buf);
while (chars > 0) {
wint_t ch = doc_next(p, st);
doskip(p, st, NULL, skip, choose);
chars -= 1;
if (is_eol(ch) && chars > 0) {
- snprintf(buf, sizeof(buf), "%d %s%s", chars,
- typenames[m->type], suffix);
+ snprintf(buf, sizeof(buf), "L %d %s %d%s", chars,
+ typenames[m->type], mergenum, suffix);
call("doc:set-attr", p, 0, st, attr,
0, NULL, buf);
}
return edlib.Efallthrough
if str == "render:merge-same":
+ # [ML] len type num {spaces}
w = str2.split()
- alen = int(w[0])
- if w[1] == "Unmatched":
+ alen = int(w[1])
+ type = w[2]
+ spaces = w[4] if len(w) >=5 else ""
+ if type == "Unmatched":
comm2("attr:cb", focus, mark, "fg:blue-80,bg:cyan+20", alen, 103)
- if w[1] == "Extraneous":
+ if type == "Extraneous":
comm2("attr:cb", focus, mark, "fg:cyan-60,bg:yellow", alen, 103)
- if w[1] == "Changed":
+ if type == "Changed":
if mark < a:
comm2("attr:cb", focus, mark, "fg:red-60", alen, 103)
else:
comm2("attr:cb", focus, mark, "fg:green-60", alen, 103)
- if w[1] == "Conflict":
- if len(w) >= 3 and w[2] == "spaces":
+ if type == "Conflict":
+ if spaces == "spaces":
comm2("attr:cb", focus, mark, "fg:red-60,underline", alen, 103)
else:
comm2("attr:cb", focus, mark, "fg:red-60,inverse", alen, 103)
- if w[1] == "AlreadyApplied":
+ if type == "AlreadyApplied":
if mark > b and mark < a:
# This part is 'before' - mosly irrelevant
comm2("attr:cb", focus, mark, "fg:cyan-60", alen, 103)