]> granicus.if.org Git - vim/commitdiff
patch 8.1.0812: Unicode 16 feature is not useful v8.1.0812
authorBram Moolenaar <Bram@vim.org>
Thu, 24 Jan 2019 17:20:17 +0000 (18:20 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 24 Jan 2019 17:20:17 +0000 (18:20 +0100)
Problem:    Unicode 16 feature is not useful and cannot be detected.
Solution:   Remove UNICODE16.

src/feature.h
src/screen.c
src/version.c
src/vim.h

index 81b432db032454d439ad28a11b307069da45fc98..e2f9e2a004f4c792e17eb45f10d0c0976e78a33b 100644 (file)
  *                     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!
index 95a739af0faf3c11b8c6ac69eca86fca0ac2989b..a80e8de65e2b3cb65d41eeb70a9bf5f5da9429c2 100644 (file)
@@ -2515,12 +2515,7 @@ text_to_screenline(win_T *wp, char_u *text, int col)
                        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;
+                   ScreenLinesUC[idx] = u8c;
                    for (i = 0; i < Screen_mco; ++i)
                    {
                        ScreenLinesC[i][idx] = u8cc[i];
@@ -4482,34 +4477,17 @@ win_line(
 
                    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
-                                                        )))
+                           || (mb_l > 1 && (!vim_isprintc(mb_c))))
                    {
                        /*
                         * 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);
+                       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");
+                       if (wp->w_p_rl)         /* reverse */
+                           rl_mirror(extra);
 # endif
-
                        p_extra = extra;
                        c = *p_extra;
                        mb_c = mb_ptr2char_adv(&p_extra);
@@ -7478,15 +7456,6 @@ screen_puts_len(
                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))
                {
index c472ece2c709feb3aff8e382394df2bafd68d4c8..111464169a3b29e78e31a969037987076539ace9 100644 (file)
@@ -787,6 +787,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    812,
 /**/
     811,
 /**/
index 3febc62ffa46c54365e6b6a896f40c24c321edbe..55cb69389c9a857c0aa81721d7031bc7331dac44 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -431,15 +431,9 @@ typedef unsigned short sattr_T;
 
 /*
  * 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.
+ * We use 32 bits, since some Asian characters don't fit in 16 bits.
  */
-#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
+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>