diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-15 21:34:18 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-15 21:34:18 +0200 |
commit | 8b51b7f0f17af149a8ce76e805050977857f9e50 (patch) | |
tree | 62937457eb147bf903de64ec6ef863e97db20abd /src/ops.c | |
parent | ad5e5631c5dc93a50bbe637be254c5e9968848ea (diff) | |
download | vim-git-8b51b7f0f17af149a8ce76e805050977857f9e50.tar.gz |
patch 8.2.1690: text properties not adjusted for "I" in Visual block modev8.2.1690
Problem: Text properties not adjusted for "I" in Visual block mode.
Solution: Call inserted_bytes().
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -481,6 +481,7 @@ block_insert( int count = 0; // extra spaces to replace a cut TAB int spaces = 0; // non-zero if cutting a TAB colnr_T offset; // pointer along new line + colnr_T startcol; // column where insert starts unsigned s_len; // STRLEN(s) char_u *newp, *oldp; // new, old lines linenr_T lnum; // loop var @@ -553,9 +554,10 @@ block_insert( // insert pre-padding vim_memset(newp + offset, ' ', (size_t)spaces); + startcol = offset + spaces; // copy the new text - mch_memmove(newp + offset + spaces, s, (size_t)s_len); + mch_memmove(newp + startcol, s, (size_t)s_len); offset += s_len; if (spaces && !bdp->is_short) @@ -574,6 +576,10 @@ block_insert( ml_replace(lnum, newp, FALSE); + if (b_insert) + // correct any text properties + inserted_bytes(lnum, startcol, s_len); + if (lnum == oap->end.lnum) { // Set "']" mark to the end of the block instead of the end of |