diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-04 18:07:24 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-04 18:07:24 +0100 |
commit | 21b5038e02306ce2fd438249055eed372befe51f (patch) | |
tree | 6d84ecc6531ca6c594ab9310a2cd45cbcee21b91 /src/evalfunc.c | |
parent | 7f1664e392388fd38c8b154389167ad1bdedff66 (diff) |
patch 8.1.0690: setline() and setbufline() do not clear text propertiesv8.1.0690
Problem: setline() and setbufline() do not clear text properties.
Solution: Clear text properties when setting the text.
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 8e530f43e1..58f58060ef 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1357,8 +1357,10 @@ set_buffer_lines( if (!append && lnum <= curbuf->b_ml.ml_line_count) { - /* existing line, replace it */ - if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK) + // Existing line, replace it. + // Removes any existing text properties. + if (u_savesub(lnum) == OK && ml_replace_len( + lnum, line, (colnr_T)STRLEN(line) + 1, TRUE, TRUE) == OK) { changed_bytes(lnum, 0); if (is_curbuf && lnum == curwin->w_cursor.lnum) |