mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 02:16:31 +00:00
fix(lua): make vim.str_utfindex and vim.str_byteindex handle NUL bytes
fixes #16290
This commit is contained in:
@@ -2296,8 +2296,9 @@ void ml_add_deleted_len_buf(buf_T *buf, char_u *ptr, ssize_t len)
|
||||
if (inhibit_delete_count) {
|
||||
return;
|
||||
}
|
||||
if (len == -1) {
|
||||
len = (ssize_t)STRLEN(ptr);
|
||||
ssize_t maxlen = (ssize_t)STRLEN(ptr);
|
||||
if (len == -1 || len > maxlen) {
|
||||
len = maxlen;
|
||||
}
|
||||
curbuf->deleted_bytes += (size_t)len + 1;
|
||||
curbuf->deleted_bytes2 += (size_t)len + 1;
|
||||
|
Reference in New Issue
Block a user