texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5589] multi-column characters


From: Gavin D. Smith
Subject: [5589] multi-column characters
Date: Mon, 19 May 2014 22:38:13 +0000

Revision: 5589
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5589
Author:   gavin
Date:     2014-05-19 22:38:12 +0000 (Mon, 19 May 2014)
Log Message:
-----------
multi-column characters

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info-utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-05-19 22:09:03 UTC (rev 5588)
+++ trunk/ChangeLog     2014-05-19 22:38:12 UTC (rev 5589)
@@ -4,6 +4,9 @@
        stdin, stdout and stderr.
        * info/t/README: File added.
 
+       * info/info-utils.c (printed_representation): Proper cursor
+       positioning for multi-column characters.
+
 2014-05-19  Gavin Smith  <address@hidden>
 
        * info/nodemenu.c (get_visited_nodes): Don't reuse a local

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2014-05-19 22:09:03 UTC (rev 5588)
+++ trunk/info/info-utils.c     2014-05-19 22:38:12 UTC (rev 5589)
@@ -28,6 +28,7 @@
 #if HAVE_ICONV
 # include <iconv.h>
 #endif
+#include <wchar.h>
 
 #ifdef __hpux
 #define va_copy(ap1,ap2) memcpy((&ap1),(&ap2),sizeof(va_list))
@@ -491,7 +492,9 @@
 
   if (mb_isprint (mbi_cur (*iter)))
     {
-      *pchars = 1;
+      /* cur.wc gives a wchar_t object.  See mbiter.h in the
+         gnulib/lib directory. */
+      *pchars = wcwidth ((*iter).cur.wc);
       *pbytes = cur_len;
       return cur_ptr;
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]