diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-12-28 21:59:29 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-12-28 21:59:29 +0100 |
commit | c1a9bc1a7284bd0e60f9bddfef6a4ee733bfc838 (patch) | |
tree | 9c266841989772395105befd1d5a14c573905a5e /src/misc2.c | |
parent | 3de8c2d1f027410db6a06f0fcd3355d96c8b8596 (diff) | |
download | vim-git-c1a9bc1a7284bd0e60f9bddfef6a4ee733bfc838.tar.gz |
patch 8.1.0654: when deleting a line text property flags are not adjustedv8.1.0654
Problem: When deleting a line text property flags are not adjusted.
Solution: Adjust text property flags in preceding and following lines.
Diffstat (limited to 'src/misc2.c')
-rw-r--r-- | src/misc2.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/misc2.c b/src/misc2.c index 3834979b8..07bdf85f8 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1351,6 +1351,20 @@ vim_strnsave(char_u *string, int len) } /* + * 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. */ |