From 2411b6f137feaf49ff8a09985cd4d9c447030309 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 20 May 2017 03:21:18 +0300 Subject: charset: Fix V695: dead branches Based on comments it appears that some non-printable characters intended to be shown as `|x` (0xA0..0xFE) and some as `~x` (0x80..0x9F, 0xFF, excluding previous). But this never happens because this is being catched by condition `c >= 0x80` above which makes them be represented as ``. Since I find this variant more useful and it additionally is backwards compatible (Vim does the same thing) I just dropped dead branches. --- src/nvim/charset.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/nvim/charset.c b/src/nvim/charset.c index ee58e0af91..5a0590d075 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -544,19 +544,9 @@ void transchar_nonprint(char_u *buf, int c) // DEL displayed as ^? buf[1] = (char_u)(c ^ 0x40); - buf[2] = NUL; - } else if (c >= 0x80) { - transchar_hex(buf, c); - } else if ((c >= ' ' + 0x80) && (c <= '~' + 0x80)) { - // 0xa0 - 0xfe - buf[0] = '|'; - buf[1] = (char_u)(c - 0x80); buf[2] = NUL; } else { - // 0x80 - 0x9f and 0xff - buf[0] = '~'; - buf[1] = (char_u)((c - 0x80) ^ 0x40); - buf[2] = NUL; + transchar_hex(buf, c); } } -- cgit