summaryrefslogtreecommitdiffstats
path: root/src/register.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-28 21:54:27 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-28 21:54:27 +0200
commit7d7bcc6ba01454c1cbb1dcbf5f11c3a4051535d6 (patch)
treeb06193f3c932181a7f6c50c86c1c1f603e288f9e /src/register.c
parent127950241e84c822d3c50f46a00d42a70d2d5cb6 (diff)
patch 8.2.3072: "zy" does not work well when "virtualedit' is "block"v8.2.3072
Problem: The "zy" command does not work well when 'virtualedit' is set to "block". (Johann Höchtl) Solution: Make endspaces zero. (Christian Brabandt, closes #8468, closes #8448)
Diffstat (limited to 'src/register.c')
-rw-r--r--src/register.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/register.c b/src/register.c
index 4774e2a995..93ee7aad97 100644
--- a/src/register.c
+++ b/src/register.c
@@ -1455,6 +1455,8 @@ yank_copy_line(struct block_def *bd, long y_idx, int exclude_trailing_space)
{
char_u *pnew;
+ if (exclude_trailing_space)
+ bd->endspaces = 0;
if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1))
== NULL)
return FAIL;
@@ -2747,7 +2749,7 @@ write_reg_contents_lst(
&yank_type) == FAIL)
return;
- str_to_reg(y_current, yank_type, (char_u *) strings, -1, block_len, TRUE);
+ str_to_reg(y_current, yank_type, (char_u *)strings, -1, block_len, TRUE);
finish_write_reg(name, old_y_previous, old_y_current);
}