]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.404
- new
[packages/vim.git] / 6.2.404
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.404
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 6.2.404
11 Problem:    Our own function to determine width of Unicode characters may get
12             outdated. (Markus Kuhn)
13 Solution:   Use wcwidth() when it is available.  Also use iswprint().
14 Files:      src/auto/configure, src/configure.in, src/config.h.in, src/mbyte.c
15
16
17 *** ../vim-6.2.403/src/auto/configure   Tue Mar 16 18:03:23 2004
18 --- src/auto/configure  Fri Mar 26 13:15:11 2004
19 ***************
20 *** 5562,5582 ****
21         sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
22         poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
23         libgen.h util/debug.h util/msg18n.h frame.h \
24 !       sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h
25   do
26   ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
27   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
28 ! echo "configure:5421: checking for $ac_hdr" >&5
29   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
30     echo $ac_n "(cached) $ac_c" 1>&6
31   else
32     cat > conftest.$ac_ext <<EOF
33 ! #line 5426 "configure"
34   #include "confdefs.h"
35   #include <$ac_hdr>
36   EOF
37   ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
38 ! { (eval echo configure:5431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
39   ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
40   if test -z "$ac_err"; then
41     rm -rf conftest*
42 --- 5566,5586 ----
43         sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
44         poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
45         libgen.h util/debug.h util/msg18n.h frame.h \
46 !       sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h wchar.h
47   do
48   ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
49   echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
50 ! echo "configure:5574: checking for $ac_hdr" >&5
51   if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
52     echo $ac_n "(cached) $ac_c" 1>&6
53   else
54     cat > conftest.$ac_ext <<EOF
55 ! #line 5579 "configure"
56   #include "confdefs.h"
57   #include <$ac_hdr>
58   EOF
59   ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
60 ! { (eval echo configure:5584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
61   ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
62   if test -z "$ac_err"; then
63     rm -rf conftest*
64 *** ../vim-6.2.403/src/configure.in     Tue Mar 16 18:03:23 2004
65 --- src/configure.in    Fri Mar 26 13:12:08 2004
66 ***************
67 *** 1829,1835 ****
68         sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
69         poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
70         libgen.h util/debug.h util/msg18n.h frame.h \
71 !       sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h)
72   
73   dnl On Mac OS X strings.h exists but produces a warning message :-(
74   if test "x$MACOSX" != "xyes"; then
75 --- 1829,1835 ----
76         sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
77         poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
78         libgen.h util/debug.h util/msg18n.h frame.h \
79 !       sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h wchar.h)
80   
81   dnl On Mac OS X strings.h exists but produces a warning message :-(
82   if test "x$MACOSX" != "xyes"; then
83 *** ../vim-6.2.403/src/config.h.in      Sun May 25 18:07:42 2003
84 --- src/config.h.in     Fri Mar 26 13:14:12 2004
85 ***************
86 *** 222,227 ****
87 --- 222,228 ----
88   #undef HAVE_SYS_SYSTEMINFO_H
89   #undef HAVE_SYS_TIME_H
90   #undef HAVE_SYS_UTSNAME_H
91 + #undef HAVE_WCHAR_H
92   #undef HAVE_TERMCAP_H
93   #undef HAVE_TERMIOS_H
94   #undef HAVE_TERMIO_H
95 *** ../vim-6.2.403/src/mbyte.c  Sun Mar 14 20:12:26 2004
96 --- src/mbyte.c Fri Mar 26 14:06:44 2004
97 ***************
98 *** 109,114 ****
99 --- 109,118 ----
100   # endif
101   #endif
102   
103 + #ifdef HAVE_WCHAR_H
104 + # include <wchar.h>
105 + #endif
106
107   #if defined(FEAT_MBYTE) || defined(PROTO)
108   
109   static int enc_canon_search __ARGS((char_u *name));
110 ***************
111 *** 1099,1109 ****
112         {0x2642, 0x2642}, {0x2660, 0x2661}, {0x2663, 0x2665},
113         {0x2667, 0x266A}, {0x266C, 0x266D}, {0x266F, 0x266F},
114         {0x273D, 0x273D}, {0x2776, 0x277F}, {0xE000, 0xF8FF},
115 !       {0xFFFD, 0xFFFD}
116       };
117   
118       if (c >= 0x100)
119       {
120         if (!utf_printable(c))
121             return 6;           /* unprintable, displays <xxxx> */
122         if (c >= 0x1100
123 --- 1103,1125 ----
124         {0x2642, 0x2642}, {0x2660, 0x2661}, {0x2663, 0x2665},
125         {0x2667, 0x266A}, {0x266C, 0x266D}, {0x266F, 0x266F},
126         {0x273D, 0x273D}, {0x2776, 0x277F}, {0xE000, 0xF8FF},
127 !       {0xFFFD, 0xFFFD}, /* {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD} */
128       };
129   
130       if (c >= 0x100)
131       {
132 + #ifdef __STDC_ISO_10646__
133 +       /*
134 +        * Assume the library function wcwidth() works better than our own
135 +        * stuff.  It should return 1 for ambiguous width chars!
136 +        */
137 +       int     n = wcwidth(c);
138
139 +       if (n < 0)
140 +           return 6;           /* unprintable, displays <xxxx> */
141 +       if (n > 1)
142 +           return n;
143 + #else
144         if (!utf_printable(c))
145             return 6;           /* unprintable, displays <xxxx> */
146         if (c >= 0x1100
147 ***************
148 *** 1118,1125 ****
149                 || (c >= 0xfe30 && c <= 0xfe6f) /* CJK Compatibility Forms */
150                 || (c >= 0xff00 && c <= 0xff60) /* Fullwidth Forms */
151                 || (c >= 0xffe0 && c <= 0xffe6)
152 !               || (c >= 0x20000 && c <= 0x2ffff)))
153             return 2;
154       }
155   
156       /* Characters below 0x100 are influenced by 'isprint' option */
157 --- 1134,1143 ----
158                 || (c >= 0xfe30 && c <= 0xfe6f) /* CJK Compatibility Forms */
159                 || (c >= 0xff00 && c <= 0xff60) /* Fullwidth Forms */
160                 || (c >= 0xffe0 && c <= 0xffe6)
161 !               || (c >= 0x20000 && c <= 0x2fffd)
162 !               || (c >= 0x30000 && c <= 0x3fffd)))
163             return 2;
164 + #endif
165       }
166   
167       /* Characters below 0x100 are influenced by 'isprint' option */
168 ***************
169 *** 1748,1753 ****
170 --- 1766,1777 ----
171   utf_printable(c)
172       int               c;
173   {
174 + #ifdef __STDC_ISO_10646__
175 +     /*
176 +      * Assume the iswprint() library function works better than our own stuff.
177 +      */
178 +     return iswprint(c);
179 + #else
180       /* Sorted list of non-overlapping intervals.
181        * 0xd800-0xdfff is reserved for UTF-16, actually illegal. */
182       static struct interval nonprint[] =
183 ***************
184 *** 1758,1763 ****
185 --- 1782,1788 ----
186       };
187   
188       return !intable(nonprint, sizeof(nonprint), c);
189 + #endif
190   }
191   
192   /*
193 ***************
194 *** 1771,1777 ****
195       int               c;
196   {
197       /* sorted list of non-overlapping intervals */
198 !     static struct interval
199       {
200         unsigned short first;
201         unsigned short last;
202 --- 1796,1802 ----
203       int               c;
204   {
205       /* sorted list of non-overlapping intervals */
206 !     static struct clinterval
207       {
208         unsigned short first;
209         unsigned short last;
210 ***************
211 *** 1840,1846 ****
212         {0xff5b, 0xff65, 1},            /* half/fullwidth ASCII */
213       };
214       int bot = 0;
215 !     int top = sizeof(classes) / sizeof(struct interval) - 1;
216       int mid;
217   
218       /* First quick check for Latin1 characters, use 'iskeyword'. */
219 --- 1865,1871 ----
220         {0xff5b, 0xff65, 1},            /* half/fullwidth ASCII */
221       };
222       int bot = 0;
223 !     int top = sizeof(classes) / sizeof(struct clinterval) - 1;
224       int mid;
225   
226       /* First quick check for Latin1 characters, use 'iskeyword'. */
227 *** ../vim-6.2.403/src/version.c        Fri Mar 26 10:38:21 2004
228 --- src/version.c       Fri Mar 26 14:22:51 2004
229 ***************
230 *** 639,640 ****
231 --- 639,642 ----
232   {   /* Add new patch number below this line */
233 + /**/
234 +     404,
235   /**/
236
237 -- 
238 You are not really successful until someone claims he sat
239 beside you in school.
240
241  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
242 ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
243 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
244  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
This page took 0.048454 seconds and 3 git commands to generate.