]> granicus.if.org Git - mutt/commitdiff
support non-breakable space character in the pager
authorMichael Elkins <me@sigpipe.org>
Thu, 7 Oct 2010 21:43:14 +0000 (14:43 -0700)
committerMichael Elkins <me@sigpipe.org>
Thu, 7 Oct 2010 21:43:14 +0000 (14:43 -0700)
pager.c

diff --git a/pager.c b/pager.c
index e19174cd02c558e7ed8b804b681e02537353f2ae..a68a93b1fb245c92abdbaf4275d74bf5b63999ca 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1187,10 +1187,17 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
       last_special = special;
     }
 
-    if (IsWPrint (wc))
+    if (IsWPrint (wc) || (Charset_is_utf8 && wc == 0x00A0))
     {
       if (wc == ' ')
        space = ch;
+      else if (Charset_is_utf8 && wc == 0x00A0)
+      {
+       /* Convert non-breaking space to normal space. The local variable
+        * `space' is not set here so that the caller of this function won't
+        * attempt to wrap at this character. */
+       wc = ' ';
+      }
       t = wcwidth (wc);
       if (col + t > wrap_cols)
        break;