nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Fixes for 1.3.11


From: David Lawrence Ramsey
Subject: Re: [Nano-devel] Fixes for 1.3.11
Date: Fri, 19 May 2006 14:18:11 -0400
User-agent: Thunderbird 1.5.0.2 (X11/20060420)

David Lawrence Ramsey wrote:

<snip>

> Make that four, given the just-reported wrapping problem.

Make that five, and sorry for the inconvenience.  (I suppose it's good
that nano's in bugfix mode.)  There's an off-by-one display problem when
trying to display a line of double-column characters: the "$" drawn at
the beginning of the line shifts it backwards one column.  nano should
display two spaces for the character in order to avoid this problem. The problem is demonstrated in the attached column.txt; open it in UTF-8
mode, hit End, and note that it's one column too short, since the entire
line is made up of double-column characters.  The attached
nano1311columnfix.patch will fix this.

香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香香
diff -ur nano-1.3.11/src/winio.c nano-1.3.11-fixed/src/winio.c
--- nano-1.3.11/src/winio.c     2006-03-29 20:18:29.000000000 -0500
+++ nano-1.3.11-fixed/src/winio.c       2006-05-19 14:08:24.000000000 -0400
@@ -1857,7 +1857,12 @@
            }
        }
 #ifdef ENABLE_UTF8
-       else if (ISSET(USE_UTF8) && mbwidth(buf_mb) > 1) {
+       else if (ISSET(USE_UTF8) && mbwidth(buf_mb) == 2) {
+           if (column >= start_col) {
+               converted[index++] = ' ';
+               start_col++;
+           }
+
            converted[index++] = ' ';
            start_col++;
 

reply via email to

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