1
0
forked from aniani/vim

patch 8.1.0654: when deleting a line text property flags are not adjusted

Problem:    When deleting a line text property flags are not adjusted.
Solution:   Adjust text property flags in preceding and following lines.
This commit is contained in:
Bram Moolenaar
2018-12-28 21:59:29 +01:00
parent 3de8c2d1f0
commit c1a9bc1a72
5 changed files with 193 additions and 10 deletions

View File

@@ -1350,6 +1350,20 @@ vim_strnsave(char_u *string, int len)
return p;
}
/*
* Copy "p[len]" into allocated memory, ignoring NUL characters.
* Returns NULL when out of memory.
*/
char_u *
vim_memsave(char_u *p, int len)
{
char_u *ret = alloc((unsigned)len);
if (ret != NULL)
mch_memmove(ret, p, (size_t)len);
return ret;
}
/*
* Same as vim_strsave(), but any characters found in esc_chars are preceded
* by a backslash.