From 1c03a064870af18f50d4f11cf4c7532c5cfae495 Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Wed, 29 Aug 2018 21:15:32 +0300 Subject: Refactor: remove mb_ptr2len_len, mb_ptr2cells and mb_ptr2cells_len Remove occurences of these macros. --- src/nvim/hardcopy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/hardcopy.c') diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index a2f48f46aa..3853f42d55 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -893,7 +893,7 @@ static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T } else { need_break = mch_print_text_out(line + col, (size_t)outputlen); if (has_mbyte) - print_pos += (*mb_ptr2cells)(line + col); + print_pos += utf_ptr2cells(line + col); else print_pos++; } @@ -2912,7 +2912,7 @@ int mch_print_text_out(char_u *const textp, size_t len) } } if (prt_out_mbyte) { - const bool half_width = ((*mb_ptr2cells)(p) == 1); + const bool half_width = (utf_ptr2cells(p) == 1); if (half_width) { char_width /= 2; } -- cgit From 1015aa6ff36b6f936f4707119d57cf561df28feb Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Wed, 29 Aug 2018 21:55:35 +0300 Subject: Remove has_mbytes from lines local to parent commit --- src/nvim/hardcopy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/hardcopy.c') diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 3853f42d55..a8731d5bd7 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -892,10 +892,7 @@ static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T need_break = 1; } else { need_break = mch_print_text_out(line + col, (size_t)outputlen); - if (has_mbyte) - print_pos += utf_ptr2cells(line + col); - else - print_pos++; + print_pos += utf_ptr2cells(line + col); } } -- cgit