0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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().
This commit is contained in:
Bram Moolenaar
2020-09-15 21:34:18 +02:00
parent ad5e5631c5
commit 8b51b7f0f1
5 changed files with 42 additions and 2 deletions

View File

@@ -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