diff options
author | Lewis Russell <lewis6991@gmail.com> | 2022-05-21 04:31:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 20:31:32 -0700 |
commit | 4c97e17d3867418919800bdf4f8079601c79bc12 (patch) | |
tree | 811948ef197a5a77550847b78c0306c5d0d8ac71 | |
parent | afa99f42b3ff45ef240e60bc8b428b8cda7ddd6e (diff) | |
download | rneovim-4c97e17d3867418919800bdf4f8079601c79bc12.tar.gz rneovim-4c97e17d3867418919800bdf4f8079601c79bc12.tar.bz2 rneovim-4c97e17d3867418919800bdf4f8079601c79bc12.zip |
refactor: remove unused USE_WCHAR_FUNCTIONS #18618
USE_WCHAR_FUNCTIONS is never defined and we don't trust libc wchar
functions anyway.
-rw-r--r-- | src/nvim/mbyte.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 3868d65ab9..adf071fa77 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -473,27 +473,12 @@ static bool intable(const struct interval *table, size_t n_items, int c) int utf_char2cells(int c) { if (c >= 0x100) { -#ifdef USE_WCHAR_FUNCTIONS - // - // Assume the library function wcwidth() works better than our own - // stuff. It should return 1 for ambiguous width chars! - // - int n = wcwidth(c); - - if (n < 0) { - return 6; // unprintable, displays <xxxx> - } - if (n > 1) { - return n; - } -#else if (!utf_printable(c)) { return 6; // unprintable, displays <xxxx> } if (intable(doublewidth, ARRAY_SIZE(doublewidth), c)) { return 2; } -#endif if (p_emoji && intable(emoji_width, ARRAY_SIZE(emoji_width), c)) { return 2; } @@ -1061,12 +1046,6 @@ bool utf_iscomposing(int c) */ bool utf_printable(int c) { -#ifdef USE_WCHAR_FUNCTIONS - /* - * Assume the iswprint() library function works better than our own stuff. - */ - return iswprint(c); -#else // Sorted list of non-overlapping intervals. // 0xd800-0xdfff is reserved for UTF-16, actually illegal. static struct interval nonprint[] = @@ -1077,7 +1056,6 @@ bool utf_printable(int c) }; return !intable(nonprint, ARRAY_SIZE(nonprint), c); -#endif } /* |