]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.303
- updated to 6.2.430
[packages/vim.git] / 6.2.303
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.303
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.303
11 Problem:    Cannot use Unicode digraphs while 'encoding' is not Unicode.
12 Solution:   Convert the character from Unicode to 'encoding' when needed.
13             Use the Unicode digraphs for the Macintosh. (Eckehard Berns)
14 Files:      src/digraph.c
15
16
17 *** ../vim-6.2.302/src/digraph.c        Thu Feb  5 16:04:26 2004
18 --- src/digraph.c       Wed Feb 25 15:12:53 2004
19 ***************
20 *** 390,396 ****
21         };
22   
23   #   else
24 ! #    ifdef MACOS
25   
26         /*
27          * Macintosh digraphs
28 --- 390,396 ----
29         };
30   
31   #   else
32 ! #    if defined(MACOS) && !defined(FEAT_MBYTE)
33   
34         /*
35          * Macintosh digraphs
36 ***************
37 *** 813,818 ****
38 --- 813,819 ----
39         {'y', ':', 0xff},
40   
41   #      ifdef FEAT_MBYTE
42 + #     define USE_UNICODE_DIGRAPHS
43   
44         {'A', '-', 0x0100},
45         {'a', '-', 0x0101},
46 ***************
47 *** 2110,2115 ****
48 --- 2111,2149 ----
49         }
50       }
51   #ifdef FEAT_MBYTE
52 + # ifdef USE_UNICODE_DIGRAPHS
53 +     if (retval != 0 && !enc_utf8)
54 +     {
55 +       char_u      buf[6], *to;
56 +       vimconv_T   vc;
57 +       int         utflen;
58
59 +       /*
60 +        * Convert the Unicode digraph to 'encoding'.
61 +        */
62 +       i = utf_char2bytes(retval, buf);
63 +       if (convert_setup(&vc, (char_u *)"utf-8", p_enc) == OK)
64 +       {
65 +           utflen = i;
66 +           to = string_convert(&vc, buf, &i);
67 +           if (to != NULL)
68 +           {
69 +               /* Checking for invalid values isn't very easy. Internal
70 +                * latin1 conversion will return char 0xbf in case it can't be
71 +                * converted */
72 +               if ((i > 1 && !has_mbyte)
73 +                       || (vc.vc_type == CONV_TO_LATIN1 && utflen != 1
74 +                                                           && to[0] == 0xbf))
75 +                   /* assume invalid value */
76 +                   retval = 0;
77 +               else
78 +                   retval = (*mb_ptr2char)(to);
79 +               vim_free(to);
80 +           }
81 +       }
82 +     }
83 + # endif
84
85       /* Ignore multi-byte characters when not in multi-byte mode. */
86       if (!has_mbyte && retval > 0xff)
87         retval = 0;
88 ***************
89 *** 2219,2230 ****
90       dp = digraphdefault;
91       for (i = 0; dp->char1 != NUL && !got_int; ++i)
92       {
93         if (getexactdigraph(dp->char1, dp->char2, FALSE) == dp->result
94 ! #ifdef FEAT_MBYTE
95                 && (has_mbyte || dp->result <= 255)
96 ! #endif
97                 )
98             printdigraph(dp);
99         ++dp;
100         ui_breakcheck();
101       }
102 --- 2253,2277 ----
103       dp = digraphdefault;
104       for (i = 0; dp->char1 != NUL && !got_int; ++i)
105       {
106 + #if defined(USE_UNICODE_DIGRAPHS) && defined(FEAT_MBYTE)
107 +       digr_T tmp;
108
109 +       /* May need to convert the result to 'encoding'. */
110 +       tmp.char1 = dp->char1;
111 +       tmp.char2 = dp->char2;
112 +       tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE);
113 +       if (tmp.result != 0 && tmp.result != tmp.char2
114 +                                         && (has_mbyte || tmp.result <= 255))
115 +           printdigraph(&tmp);
116 + #else
117
118         if (getexactdigraph(dp->char1, dp->char2, FALSE) == dp->result
119 ! # ifdef FEAT_MBYTE
120                 && (has_mbyte || dp->result <= 255)
121 ! # endif
122                 )
123             printdigraph(dp);
124 + #endif
125         ++dp;
126         ui_breakcheck();
127       }
128 *** ../vim-6.2.302/src/version.c        Mon Mar  1 16:54:50 2004
129 --- src/version.c       Mon Mar  1 16:59:41 2004
130 ***************
131 *** 639,640 ****
132 --- 639,642 ----
133   {   /* Add new patch number below this line */
134 + /**/
135 +     303,
136   /**/
137
138 -- 
139 MORTICIAN:    What?
140 CUSTOMER:     Nothing -- here's your nine pence.
141 DEAD PERSON:  I'm not dead!
142 MORTICIAN:    Here -- he says he's not dead!
143 CUSTOMER:     Yes, he is.
144 DEAD PERSON:  I'm not!
145                                   The Quest for the Holy Grail (Monty Python)
146
147  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
148 ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
149 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
150  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
This page took 0.041591 seconds and 3 git commands to generate.