aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-05-20 03:21:18 +0300
committerZyX <kp-pav@yandex.ru>2017-05-20 03:21:18 +0300
commit2411b6f137feaf49ff8a09985cd4d9c447030309 (patch)
tree3367aa8a0b68caa83a577b4b642d230eac612e17
parent3280765f2dde4ba6d120387908d735ed763db01c (diff)
downloadrneovim-2411b6f137feaf49ff8a09985cd4d9c447030309.tar.gz
rneovim-2411b6f137feaf49ff8a09985cd4d9c447030309.tar.bz2
rneovim-2411b6f137feaf49ff8a09985cd4d9c447030309.zip
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 `<A0>`. Since I find this variant more useful and it additionally is backwards compatible (Vim does the same thing) I just dropped dead branches.
-rw-r--r--src/nvim/charset.c12
1 files changed, 1 insertions, 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
@@ -545,18 +545,8 @@ void transchar_nonprint(char_u *buf, int c)
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);
}
}