diff options
author | Michael Reed <m.reed@mykolab.com> | 2015-02-03 20:55:00 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-03-05 19:03:35 -0500 |
commit | 70a7517d17080e8de6616fa16608fd14da0498a1 (patch) | |
tree | dbe845a445397089b8e254390a812fb1f3c077af | |
parent | c5c3eb99d3d893a4561a83041495f457fc0a9ade (diff) | |
download | rneovim-70a7517d17080e8de6616fa16608fd14da0498a1.tar.gz rneovim-70a7517d17080e8de6616fa16608fd14da0498a1.tar.bz2 rneovim-70a7517d17080e8de6616fa16608fd14da0498a1.zip |
Macro cleanup: UNICODE16
Fix clint warnings as well.
-rw-r--r-- | clint-ignored-files.txt | 1 | ||||
-rw-r--r-- | src/nvim/screen.c | 40 | ||||
-rw-r--r-- | src/nvim/types.h | 16 |
3 files changed, 9 insertions, 48 deletions
diff --git a/clint-ignored-files.txt b/clint-ignored-files.txt index 1d9b6f9a7f..7e0063aea0 100644 --- a/clint-ignored-files.txt +++ b/clint-ignored-files.txt @@ -119,7 +119,6 @@ src/nvim/tag.h src/nvim/term.c src/nvim/term.h src/nvim/term_defs.h -src/nvim/types.h src/nvim/ui.c src/nvim/ui.h src/nvim/undo.c diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 69025e15bb..f26c74998e 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1858,11 +1858,6 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T } else prev_c = u8c; /* 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]; @@ -3051,30 +3046,13 @@ 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 - ))) { - /* - * 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); - if (wp->w_p_rl) /* reverse */ + || (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); + if (wp->w_p_rl) { // reverse rl_mirror(extra); } -# 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; @@ -5226,14 +5204,6 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr) 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 if (p_arshape && !p_tbidi && arabic_char(u8c)) { /* Do Arabic shaping. */ if (len >= 0 && (int)(ptr - text) + mbyte_blen >= len) { diff --git a/src/nvim/types.h b/src/nvim/types.h index a87122d24b..afd684925a 100644 --- a/src/nvim/types.h +++ b/src/nvim/types.h @@ -13,19 +13,11 @@ // dummy to pass an ACL to a function typedef void *vim_acl_T; -/* - * Shorthand for unsigned variables. Many systems, but not all, have u_char - * already defined, so we use char_u to avoid trouble. - */ +// Shorthand for unsigned variables. Many systems, but not all, have u_char +// already defined, so we use char_u to avoid trouble. typedef unsigned char char_u; -// 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 uint16_t u8char_T; -#else +// Can hold one decoded UTF-8 character. typedef uint32_t u8char_T; -#endif -#endif /* NVIM_TYPES_H */ +#endif // NVIM_TYPES_H |