aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fold.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/fold.c')
-rw-r--r--src/nvim/fold.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index 1ed34ef124..b00c45413a 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -1687,7 +1687,7 @@ static void foldDelMarker(linenr_T lnum, char_u *marker, size_t markerlen)
assert(p >= line);
memcpy(newline, line, (size_t)(p - line));
STRCPY(newline + (p - line), p + len);
- ml_replace(lnum, newline, FALSE);
+ ml_replace(lnum, newline, false);
}
break;
}
@@ -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 = ' ';