From 8b51b7f0f17af149a8ce76e805050977857f9e50 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Sep 2020 21:34:18 +0200 Subject: patch 8.2.1690: text properties not adjusted for "I" in Visual block mode Problem: Text properties not adjusted for "I" in Visual block mode. Solution: Call inserted_bytes(). --- src/ops.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ops.c') diff --git a/src/ops.c b/src/ops.c index 2988a185b..d57294034 100644 --- a/src/ops.c +++ b/src/ops.c @@ -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 -- cgit v1.2.1