aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testing.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-10 06:35:51 +0800
committerGitHub <noreply@github.com>2024-08-10 06:35:51 +0800
commit4e8efe002e976de1a22dcce6a1e800aeb6acad70 (patch)
tree734bbdbd7a1ac6413818609a892615694770bb3a /src/nvim/testing.c
parent0d3f2c4904d552635da07a6e2b4e75520b514940 (diff)
downloadrneovim-4e8efe002e976de1a22dcce6a1e800aeb6acad70.tar.gz
rneovim-4e8efe002e976de1a22dcce6a1e800aeb6acad70.tar.bz2
rneovim-4e8efe002e976de1a22dcce6a1e800aeb6acad70.zip
vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly (#30018)
Problem: assert_equal() doesn't show multibyte string correctly Solution: Properly advance over a multibyte char. (zeertzjq) closes: vim/vim#15456 https://github.com/vim/vim/commit/9c4b2462bb498f44044616f7309d111d12170369
Diffstat (limited to 'src/nvim/testing.c')
-rw-r--r--src/nvim/testing.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/testing.c b/src/nvim/testing.c
index 4dc8984fa9..adbdd3e611 100644
--- a/src/nvim/testing.c
+++ b/src/nvim/testing.c
@@ -130,7 +130,7 @@ static void ga_concat_shorten_esc(garray_T *gap, const char *str)
return;
}
- for (const char *p = str; *p != NUL; p++) {
+ for (const char *p = str; *p != NUL;) {
int same_len = 1;
const char *s = p;
const int c = mb_cptr2char_adv(&s);
@@ -146,9 +146,10 @@ static void ga_concat_shorten_esc(garray_T *gap, const char *str)
vim_snprintf(buf, NUMBUFLEN, "%d", same_len);
ga_concat(gap, buf);
ga_concat(gap, " times]");
- p = s - 1;
+ p = s;
} else {
ga_concat_esc(gap, p, clen);
+ p += clen;
}
}
}