]> granicus.if.org Git - mutt/commitdiff
support nbsp in the pager.
authorMichael Elkins <me@sigpipe.org>
Wed, 19 Dec 2012 22:52:59 +0000 (14:52 -0800)
committerMichael Elkins <me@sigpipe.org>
Wed, 19 Dec 2012 22:52:59 +0000 (14:52 -0800)
imported from http://svnweb.freebsd.org/ports/head/mail/mutt/files/patch-nbsp?revision=301308&view=markup

pager.c

diff --git a/pager.c b/pager.c
index ade00c5f29ede839766ae46e1418382a5a7dd6d0..ece6e8b3e8b2de1975d59a7e21b33ff92e0b99fd 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;