summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0812
blob: 534690b90fe3e9d4582c609877c9ef9234015ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0812
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0812
Problem:    Unicode 16 feature is not useful and cannot be detected.
Solution:   Remove UNICODE16.
Files:	    src/screen.c, src/vim.h, src/feature.h


*** ../vim-8.1.0811/src/screen.c	2019-01-24 16:38:58.280712420 +0100
--- src/screen.c	2019-01-24 18:18:34.825156995 +0100
***************
*** 2515,2526 ****
  			prev_c = u8c;
  #endif
  		    /* Non-BMP character: display as ? or fullwidth ?. */
! #ifdef UNICODE16
! 		    if (u8c >= 0x10000)
! 			ScreenLinesUC[idx] = (cells == 2) ? 0xff1f : (int)'?';
! 		    else
! #endif
! 			ScreenLinesUC[idx] = u8c;
  		    for (i = 0; i < Screen_mco; ++i)
  		    {
  			ScreenLinesC[i][idx] = u8cc[i];
--- 2515,2521 ----
  			prev_c = u8c;
  #endif
  		    /* Non-BMP character: display as ? or fullwidth ?. */
! 		    ScreenLinesUC[idx] = u8c;
  		    for (i = 0; i < Screen_mco; ++i)
  		    {
  			ScreenLinesC[i][idx] = u8cc[i];
***************
*** 4482,4515 ****
  
  		    if ((mb_l == 1 && c >= 0x80)
  			    || (mb_l >= 1 && mb_c == 0)
! 			    || (mb_l > 1 && (!vim_isprintc(mb_c)
! # ifdef UNICODE16
! 							 || mb_c >= 0x10000
! # endif
! 							 )))
  		    {
  			/*
  			 * Illegal UTF-8 byte: display as <xx>.
  			 * Non-BMP character : display as ? or fullwidth ?.
  			 */
! # ifdef UNICODE16
! 			if (mb_c < 0x10000)
! # endif
! 			{
! 			    transchar_hex(extra, mb_c);
  # ifdef FEAT_RIGHTLEFT
! 			    if (wp->w_p_rl)		/* reverse */
! 				rl_mirror(extra);
! # endif
! 			}
! # ifdef UNICODE16
! 			else if (utf_char2cells(mb_c) != 2)
! 			    STRCPY(extra, "?");
! 			else
! 			    /* 0xff1f in UTF-8: full-width '?' */
! 			    STRCPY(extra, "\357\274\237");
  # endif
- 
  			p_extra = extra;
  			c = *p_extra;
  			mb_c = mb_ptr2char_adv(&p_extra);
--- 4477,4493 ----
  
  		    if ((mb_l == 1 && c >= 0x80)
  			    || (mb_l >= 1 && mb_c == 0)
! 			    || (mb_l > 1 && (!vim_isprintc(mb_c))))
  		    {
  			/*
  			 * Illegal UTF-8 byte: display as <xx>.
  			 * Non-BMP character : display as ? or fullwidth ?.
  			 */
! 			transchar_hex(extra, mb_c);
  # ifdef FEAT_RIGHTLEFT
! 			if (wp->w_p_rl)		/* reverse */
! 			    rl_mirror(extra);
  # endif
  			p_extra = extra;
  			c = *p_extra;
  			mb_c = mb_ptr2char_adv(&p_extra);
***************
*** 7478,7492 ****
  		else
  		    u8c = utfc_ptr2char(ptr, u8cc);
  		mbyte_cells = utf_char2cells(u8c);
- #ifdef UNICODE16
- 		/* Non-BMP character: display as ? or fullwidth ?. */
- 		if (u8c >= 0x10000)
- 		{
- 		    u8c = (mbyte_cells == 2) ? 0xff1f : (int)'?';
- 		    if (attr == 0)
- 			attr = HL_ATTR(HLF_8);
- 		}
- #endif
  #ifdef FEAT_ARABIC
  		if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c))
  		{
--- 7456,7461 ----
*** ../vim-8.1.0811/src/vim.h	2019-01-24 17:59:35.131217488 +0100
--- src/vim.h	2019-01-24 18:17:37.049510290 +0100
***************
*** 431,445 ****
  
  /*
   * The u8char_T can hold one decoded UTF-8 character.
!  * We normally use 32 bits now, since some Asian characters don't fit in 16
!  * bits.  u8char_T is only used for displaying, it could be 16 bits to save
!  * memory.
   */
! #ifdef UNICODE16
! typedef unsigned short u8char_T;    /* short should be 16 bits */
! #else
! typedef unsigned int u8char_T;	    /* int is 32 bits or more */
! #endif
  
  #ifndef UNIX		    /* For Unix this is included in os_unix.h */
  # include <stdio.h>
--- 431,439 ----
  
  /*
   * The u8char_T can hold one decoded UTF-8 character.
!  * We use 32 bits, since some Asian characters don't fit in 16 bits.
   */
! typedef unsigned int u8char_T;	// int is 32 bits or more
  
  #ifndef UNIX		    /* For Unix this is included in os_unix.h */
  # include <stdio.h>
*** ../vim-8.1.0811/src/feature.h	2019-01-24 17:59:35.131217488 +0100
--- src/feature.h	2019-01-24 18:18:45.677090411 +0100
***************
*** 601,610 ****
   *			Now always enabled.
   */
  
- /* Define this if you want to use 16 bit Unicode only, reduces memory used for
-  * the screen structures. */
- /* #define UNICODE16 */
- 
  /*
   * +multi_byte_ime	Win32 IME input method.  Only for far-east Windows, so
   *			IME can be used to input chars.  Not tested much!
--- 601,606 ----
*** ../vim-8.1.0811/src/version.c	2019-01-24 17:59:35.143217444 +0100
--- src/version.c	2019-01-24 18:19:43.044737328 +0100
***************
*** 789,790 ****
--- 789,792 ----
  {   /* Add new patch number below this line */
+ /**/
+     812,
  /**/

-- 
CONCORDE: Message for you, sir.
   He falls forward revealing the arrow with the note.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///