comparison src/screen.c @ 15609:b440c7becbca v8.1.0812

patch 8.1.0812: Unicode 16 feature is not useful commit https://github.com/vim/vim/commit/9ba6117de6dc2993f8b42ccb9754c23694db2950 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 24 18:20:17 2019 +0100 patch 8.1.0812: Unicode 16 feature is not useful Problem: Unicode 16 feature is not useful and cannot be detected. Solution: Remove UNICODE16.
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jan 2019 18:30:06 +0100
parents 639b8318472c
children dd2e0b83a660
comparison
equal deleted inserted replaced
15608:d436af1c3beb 15609:b440c7becbca
2513 } 2513 }
2514 else 2514 else
2515 prev_c = u8c; 2515 prev_c = u8c;
2516 #endif 2516 #endif
2517 /* Non-BMP character: display as ? or fullwidth ?. */ 2517 /* Non-BMP character: display as ? or fullwidth ?. */
2518 #ifdef UNICODE16 2518 ScreenLinesUC[idx] = u8c;
2519 if (u8c >= 0x10000)
2520 ScreenLinesUC[idx] = (cells == 2) ? 0xff1f : (int)'?';
2521 else
2522 #endif
2523 ScreenLinesUC[idx] = u8c;
2524 for (i = 0; i < Screen_mco; ++i) 2519 for (i = 0; i < Screen_mco; ++i)
2525 { 2520 {
2526 ScreenLinesC[i][idx] = u8cc[i]; 2521 ScreenLinesC[i][idx] = u8cc[i];
2527 if (u8cc[i] == 0) 2522 if (u8cc[i] == 0)
2528 break; 2523 break;
4480 } 4475 }
4481 } 4476 }
4482 4477
4483 if ((mb_l == 1 && c >= 0x80) 4478 if ((mb_l == 1 && c >= 0x80)
4484 || (mb_l >= 1 && mb_c == 0) 4479 || (mb_l >= 1 && mb_c == 0)
4485 || (mb_l > 1 && (!vim_isprintc(mb_c) 4480 || (mb_l > 1 && (!vim_isprintc(mb_c))))
4486 # ifdef UNICODE16
4487 || mb_c >= 0x10000
4488 # endif
4489 )))
4490 { 4481 {
4491 /* 4482 /*
4492 * Illegal UTF-8 byte: display as <xx>. 4483 * Illegal UTF-8 byte: display as <xx>.
4493 * Non-BMP character : display as ? or fullwidth ?. 4484 * Non-BMP character : display as ? or fullwidth ?.
4494 */ 4485 */
4495 # ifdef UNICODE16 4486 transchar_hex(extra, mb_c);
4496 if (mb_c < 0x10000) 4487 # ifdef FEAT_RIGHTLEFT
4488 if (wp->w_p_rl) /* reverse */
4489 rl_mirror(extra);
4497 # endif 4490 # endif
4498 {
4499 transchar_hex(extra, mb_c);
4500 # ifdef FEAT_RIGHTLEFT
4501 if (wp->w_p_rl) /* reverse */
4502 rl_mirror(extra);
4503 # endif
4504 }
4505 # ifdef UNICODE16
4506 else if (utf_char2cells(mb_c) != 2)
4507 STRCPY(extra, "?");
4508 else
4509 /* 0xff1f in UTF-8: full-width '?' */
4510 STRCPY(extra, "\357\274\237");
4511 # endif
4512
4513 p_extra = extra; 4491 p_extra = extra;
4514 c = *p_extra; 4492 c = *p_extra;
4515 mb_c = mb_ptr2char_adv(&p_extra); 4493 mb_c = mb_ptr2char_adv(&p_extra);
4516 mb_utf8 = (c >= 0x80); 4494 mb_utf8 = (c >= 0x80);
4517 n_extra = (int)STRLEN(p_extra); 4495 n_extra = (int)STRLEN(p_extra);
7476 u8c = utfc_ptr2char_len(ptr, u8cc, 7454 u8c = utfc_ptr2char_len(ptr, u8cc,
7477 (int)((text + len) - ptr)); 7455 (int)((text + len) - ptr));
7478 else 7456 else
7479 u8c = utfc_ptr2char(ptr, u8cc); 7457 u8c = utfc_ptr2char(ptr, u8cc);
7480 mbyte_cells = utf_char2cells(u8c); 7458 mbyte_cells = utf_char2cells(u8c);
7481 #ifdef UNICODE16
7482 /* Non-BMP character: display as ? or fullwidth ?. */
7483 if (u8c >= 0x10000)
7484 {
7485 u8c = (mbyte_cells == 2) ? 0xff1f : (int)'?';
7486 if (attr == 0)
7487 attr = HL_ATTR(HLF_8);
7488 }
7489 #endif
7490 #ifdef FEAT_ARABIC 7459 #ifdef FEAT_ARABIC
7491 if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c)) 7460 if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c))
7492 { 7461 {
7493 /* Do Arabic shaping. */ 7462 /* Do Arabic shaping. */
7494 if (len >= 0 && (int)(ptr - text) + mbyte_blen >= len) 7463 if (len >= 0 && (int)(ptr - text) + mbyte_blen >= len)