mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
lint
This commit is contained in:
@@ -906,19 +906,19 @@ int ins_typebuf(char_u *str, int noremap, int offset, int nottyped, bool silent)
|
|||||||
s2 = xmalloc((size_t)newlen);
|
s2 = xmalloc((size_t)newlen);
|
||||||
typebuf.tb_buflen = newlen;
|
typebuf.tb_buflen = newlen;
|
||||||
|
|
||||||
/* copy the old chars, before the insertion point */
|
// copy the old chars, before the insertion point
|
||||||
memmove(s1 + newoff, typebuf.tb_buf + typebuf.tb_off,
|
memmove(s1 + newoff, typebuf.tb_buf + typebuf.tb_off, (size_t)offset);
|
||||||
(size_t)offset);
|
// copy the new chars
|
||||||
/* copy the new chars */
|
|
||||||
memmove(s1 + newoff + offset, str, (size_t)addlen);
|
memmove(s1 + newoff + offset, str, (size_t)addlen);
|
||||||
/* copy the old chars, after the insertion point, including the NUL at
|
// copy the old chars, after the insertion point, including the NUL at
|
||||||
* the end */
|
// the end
|
||||||
int bytes = typebuf.tb_len - offset + 1;
|
int bytes = typebuf.tb_len - offset + 1;
|
||||||
assert(bytes > 0);
|
assert(bytes > 0);
|
||||||
memmove(s1 + newoff + offset + addlen,
|
memmove(s1 + newoff + offset + addlen,
|
||||||
typebuf.tb_buf + typebuf.tb_off + offset, (size_t)bytes);
|
typebuf.tb_buf + typebuf.tb_off + offset, (size_t)bytes);
|
||||||
if (typebuf.tb_buf != typebuf_init)
|
if (typebuf.tb_buf != typebuf_init) {
|
||||||
xfree(typebuf.tb_buf);
|
xfree(typebuf.tb_buf);
|
||||||
|
}
|
||||||
typebuf.tb_buf = s1;
|
typebuf.tb_buf = s1;
|
||||||
|
|
||||||
memmove(s2 + newoff, typebuf.tb_noremap + typebuf.tb_off,
|
memmove(s2 + newoff, typebuf.tb_noremap + typebuf.tb_off,
|
||||||
@@ -1064,12 +1064,12 @@ void del_typebuf(int len, int offset)
|
|||||||
typebuf.tb_noremap + typebuf.tb_off, (size_t)offset);
|
typebuf.tb_noremap + typebuf.tb_off, (size_t)offset);
|
||||||
typebuf.tb_off = MAXMAPLEN;
|
typebuf.tb_off = MAXMAPLEN;
|
||||||
}
|
}
|
||||||
/* adjust typebuf.tb_buf (include the NUL at the end) */
|
// adjust typebuf.tb_buf (include the NUL at the end)
|
||||||
int bytes = typebuf.tb_len - offset + 1;
|
int bytes = typebuf.tb_len - offset + 1;
|
||||||
assert(bytes > 0);
|
assert(bytes > 0);
|
||||||
memmove(typebuf.tb_buf + typebuf.tb_off + offset,
|
memmove(typebuf.tb_buf + typebuf.tb_off + offset,
|
||||||
typebuf.tb_buf + i + len, (size_t)bytes);
|
typebuf.tb_buf + i + len, (size_t)bytes);
|
||||||
/* adjust typebuf.tb_noremap[] */
|
// adjust typebuf.tb_noremap[]
|
||||||
memmove(typebuf.tb_noremap + typebuf.tb_off + offset,
|
memmove(typebuf.tb_noremap + typebuf.tb_off + offset,
|
||||||
typebuf.tb_noremap + i + len,
|
typebuf.tb_noremap + i + len,
|
||||||
(size_t)(typebuf.tb_len - offset));
|
(size_t)(typebuf.tb_len - offset));
|
||||||
|
Reference in New Issue
Block a user