On Tue, Jul 21, 2020 at 06:48:26PM +0300, Maxim Tarasov wrote:
Here is the correct version:

diff --git a/color.c b/color.c
index 8f3c3ba7..cee39905 100644
--- a/color.c
+++ b/color.c
@@ -258,10 +258,11 @@ int mutt_merge_colors (int source_pair, int overlay_pair)
      merged_fg = overlay->fg < 0 ? source->fg : overlay->fg;
      merged_bg = overlay->bg < 0 ? source->bg : overlay->bg;
      merged_pair = mutt_alloc_color (merged_fg, merged_bg, 0);
-      merged_pair |= (source_pair & ATTR_MASK) | (overlay_pair & ATTR_MASK);
    }
  }

+  merged_pair |= (source_pair & ATTR_MASK) | (overlay_pair & ATTR_MASK);
+
  return merged_pair;
}

This looks okay.  I'll push this up.

diff --git a/menu.c b/menu.c
index 2da07c25..369ac238 100644
--- a/menu.c
+++ b/menu.c
@@ -35,12 +35,24 @@ static size_t MenuStackCount = 0;
static size_t MenuStackLen = 0;
static MUTTMENU **MenuStack = NULL;

-static void print_enriched_string (int attr, unsigned char *s, int do_color)
+static void print_enriched_string (int base_color, unsigned char *s, int 
do_color, int is_current)

I don't like the parameter to be named is_current but doesn't reflect that fact in the callers.

What if you changed it so the callers pass is_current accurately but instead put the arrow logic inside:

+  if (option (OPTCURSOROVERLAY))
+  {
+    do_color = 1;
+    tree_color = mutt_merge_colors (base_color, tree_color);
+    if (is_current)

      if (is_current && !option(OPTARROWCURSOR))

+    {
+      tree_color = mutt_merge_colors (tree_color, 
ColorDefs[MT_COLOR_INDICATOR]);
+      base_color = mutt_merge_colors (base_color, 
ColorDefs[MT_COLOR_INDICATOR]);
+    }
+  }

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to