]> granicus.if.org Git - neomutt/commitdiff
fix width calculation
authorEric Davis <edavis@insanum.com>
Sun, 31 Jan 2016 00:23:22 +0000 (00:23 +0000)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 02:33:23 +0000 (03:33 +0100)
fixed right alignment on the index line the printed string width
computation did not account for special index coloring sequences

curs_lib.c

index 9e860b81340c49cd999311527234cdea468ec9ce..51fcd78f1b06f4a3ab648827a7a049e335abc941 100644 (file)
@@ -1041,6 +1041,13 @@ int mutt_strwidth (const char *s)
   memset (&mbstate, 0, sizeof (mbstate));
   for (w=0; n && (k = mbrtowc (&wc, s, n, &mbstate)); s += k, n -= k)
   {
+    if (*s == M_SPECIAL_INDEX)
+    {
+      s += 2; /* skip the index coloring sequence */
+      k = 0;
+      continue;
+    }
+
     if (k == (size_t)(-1) || k == (size_t)(-2))
     {
       k = (k == (size_t)(-1)) ? 1 : n;