mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
lint
This commit is contained in:
@@ -1562,12 +1562,13 @@ void ins_str(char_u *s)
|
|||||||
oldlen = (int)STRLEN(oldp);
|
oldlen = (int)STRLEN(oldp);
|
||||||
|
|
||||||
newp = (char_u *)xmalloc((size_t)oldlen + (size_t)newlen + 1);
|
newp = (char_u *)xmalloc((size_t)oldlen + (size_t)newlen + 1);
|
||||||
if (col > 0)
|
if (col > 0) {
|
||||||
memmove(newp, oldp, (size_t)col);
|
memmove(newp, oldp, (size_t)col);
|
||||||
|
}
|
||||||
memmove(newp + col, s, (size_t)newlen);
|
memmove(newp + col, s, (size_t)newlen);
|
||||||
int bytes = oldlen - col + 1;
|
int bytes = oldlen - col + 1;
|
||||||
assert(bytes >= 0);
|
assert(bytes >= 0);
|
||||||
memmove(newp + col + newlen, oldp + col, bytes);
|
memmove(newp + col + newlen, oldp + col, (size_t)bytes);
|
||||||
ml_replace(lnum, newp, false);
|
ml_replace(lnum, newp, false);
|
||||||
changed_bytes(lnum, col);
|
changed_bytes(lnum, col);
|
||||||
curwin->w_cursor.col += newlen;
|
curwin->w_cursor.col += newlen;
|
||||||
|
Reference in New Issue
Block a user