From cbdbc4f63d68a6b17b9eea5c67130e37d3d0f278 Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Sun, 2 Sep 2018 00:58:30 +0300 Subject: Refactor: Remove occurences of mb_char2bytes --- src/nvim/screen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/screen.c') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 884fef69d1..1967ef4773 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3539,7 +3539,7 @@ win_line ( xfree(p_extra_free); p_extra_free = p; for (i = 0; i < tab_len; i++) { - mb_char2bytes(lcs_tab2, p); + utf_char2bytes(lcs_tab2, p); p += mb_char2len(lcs_tab2); n_extra += mb_char2len(lcs_tab2) - (saved_nextra > 0 ? 1: 0); } @@ -5120,7 +5120,7 @@ win_redr_custom ( /* fill up with "fillchar" */ while (width < maxwidth && len < (int)sizeof(buf) - 1) { - len += (*mb_char2bytes)(fillchar, buf + len); + len += utf_char2bytes(fillchar, buf + len); ++width; } buf[len] = NUL; @@ -5229,7 +5229,7 @@ void screen_putchar(int c, int row, int col, int attr) { char_u buf[MB_MAXBYTES + 1]; - buf[(*mb_char2bytes)(c, buf)] = NUL; + buf[utf_char2bytes(c, buf)] = NUL; screen_puts(buf, row, col, attr); } @@ -6955,7 +6955,7 @@ static void win_redr_ruler(win_T *wp, int always) // Need at least 3 chars left for get_rel_pos() + NUL. while (this_ru_col + o < width && RULER_BUF_LEN > i + 4) { if (has_mbyte) - i += (*mb_char2bytes)(fillchar, buffer + i); + i += utf_char2bytes(fillchar, buffer + i); else buffer[i++] = fillchar; ++o; -- cgit From ac13e65ae0ce98516e816ba4fcf468d19e750c30 Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Sun, 2 Sep 2018 01:36:18 +0300 Subject: Remove has_mbytes local to lines changed in parent commit --- src/nvim/screen.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/screen.c') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 1967ef4773..63d8f5d506 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -6954,10 +6954,7 @@ static void win_redr_ruler(win_T *wp, int always) if (this_ru_col + o < width) { // Need at least 3 chars left for get_rel_pos() + NUL. while (this_ru_col + o < width && RULER_BUF_LEN > i + 4) { - if (has_mbyte) - i += utf_char2bytes(fillchar, buffer + i); - else - buffer[i++] = fillchar; + i += utf_char2bytes(fillchar, buffer + i); ++o; } get_rel_pos(wp, buffer + i, RULER_BUF_LEN - i); -- cgit From 329cfc3303cffd5c9aad7b2ad7f4323354d68b0d Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Sun, 2 Sep 2018 02:14:47 +0300 Subject: lint: clean-up after parent commits --- src/nvim/screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/screen.c') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 63d8f5d506..69c3d3067d 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5121,7 +5121,7 @@ win_redr_custom ( /* fill up with "fillchar" */ while (width < maxwidth && len < (int)sizeof(buf) - 1) { len += utf_char2bytes(fillchar, buf + len); - ++width; + width++; } buf[len] = NUL; @@ -6955,7 +6955,7 @@ static void win_redr_ruler(win_T *wp, int always) // Need at least 3 chars left for get_rel_pos() + NUL. while (this_ru_col + o < width && RULER_BUF_LEN > i + 4) { i += utf_char2bytes(fillchar, buffer + i); - ++o; + o++; } get_rel_pos(wp, buffer + i, RULER_BUF_LEN - i); } -- cgit