aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-16 20:56:30 +0300
committerZyX <kp-pav@yandex.ru>2017-04-16 20:56:30 +0300
commit083792e1374100f1b0c48c72987935f56ebbd8ad (patch)
treec6db0e7a07675b417e7e93ccbe995fc52936bc05
parent10ce00efa8c9d4e9f2b588063ce04f7d49050d8b (diff)
downloadrneovim-083792e1374100f1b0c48c72987935f56ebbd8ad.tar.gz
rneovim-083792e1374100f1b0c48c72987935f56ebbd8ad.tar.bz2
rneovim-083792e1374100f1b0c48c72987935f56ebbd8ad.zip
message: Remove some enc_utf8/… checks
-rw-r--r--src/nvim/message.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 3e4a1e10b6..91dfc79e38 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -1165,15 +1165,9 @@ int msg_outtrans_len_attr(char_u *msgstr, int len, int attr)
* Normal characters are printed several at a time.
*/
while (--len >= 0) {
- if (enc_utf8) {
- // Don't include composing chars after the end.
- mb_l = utfc_ptr2len_len((char_u *)str, len + 1);
- } else if (has_mbyte) {
- mb_l = (*mb_ptr2len)((char_u *)str);
- } else {
- mb_l = 1;
- }
- if (has_mbyte && mb_l > 1) {
+ // Don't include composing chars after the end.
+ mb_l = utfc_ptr2len_len((char_u *)str, len + 1);
+ if (mb_l > 1) {
c = (*mb_ptr2char)((char_u *)str);
if (vim_isprintc(c)) {
// Printable multi-byte char: count the cells.