Merge pull request #19808 from zeertzjq/vim-9.0.0220

vim-patch:9.0.{0220,0222}
This commit is contained in:
zeertzjq 2022-08-17 09:32:46 +08:00 committed by GitHub
commit d74f9c3b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -890,9 +890,9 @@ int utf_ptr2len_len(const char_u *p, int size)
return len;
}
/// Return the number of bytes occupied by a UTF-8 character in a string
///
/// Return the number of bytes occupied by a UTF-8 character in a string.
/// This includes following composing characters.
/// Returns zero for NUL.
int utfc_ptr2len(const char *const p_in)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{

View File

@ -75,6 +75,18 @@ func Test_for_invalid()
redraw
endfunc
func Test_for_over_null_string()
let save_enc = &enc
" set enc=iso8859
let cnt = 0
for c in v:_null_string
let cnt += 1
endfor
call assert_equal(0, cnt)
let &enc = save_enc
endfunc
func Test_readfile_binary()
new
call setline(1, ['one', 'two', 'three'])

View File

@ -1,7 +1,6 @@
" Test for textobjects
source check.vim
CheckFeature textobjects
func CpoM(line, useM, expected)
new