diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-08-08 01:24:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-08 01:24:18 +0200 |
commit | c06613d2f6c3f3a864c43e03b95d12efb3e0f4a6 (patch) | |
tree | 3d052800def8498c4d26887b881f99e40bb38a46 /src/nvim/fold.c | |
parent | 1593ee7cf21f77168531c959fa9e73933b502d2e (diff) | |
parent | 5cecd7a93aba83cd477519974fc33fadbdcfdc87 (diff) | |
download | rneovim-c06613d2f6c3f3a864c43e03b95d12efb3e0f4a6.tar.gz rneovim-c06613d2f6c3f3a864c43e03b95d12efb3e0f4a6.tar.bz2 rneovim-c06613d2f6c3f3a864c43e03b95d12efb3e0f4a6.zip |
Merge #8665 'Remove mb_ptr2char macro'
Diffstat (limited to 'src/nvim/fold.c')
-rw-r--r-- | src/nvim/fold.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 1ed34ef124..6aae927483 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -1763,12 +1763,13 @@ char_u *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume, if (text != NULL) { /* Replace unprintable characters, if there are any. But * replace a TAB with a space. */ - for (p = text; *p != NUL; ++p) { - int len; + for (p = text; *p != NUL; p++) { + int len = utfc_ptr2len(p); - if (has_mbyte && (len = (*mb_ptr2len)(p)) > 1) { - if (!vim_isprintc((*mb_ptr2char)(p))) + if (len > 1) { + if (!vim_isprintc(utf_ptr2char(p))) { break; + } p += len - 1; } else if (*p == TAB) *p = ' '; |