comparison src/register.c @ 25070:f397a21b3e4c v8.2.3072

patch 8.2.3072: "zy" does not work well when "virtualedit' is "block" Commit: https://github.com/vim/vim/commit/7d7bcc6ba01454c1cbb1dcbf5f11c3a4051535d6 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 28 21:54:27 2021 +0200 patch 8.2.3072: "zy" does not work well when "virtualedit' is "block" 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Jun 2021 22:00:05 +0200
parents dc3d45d9a4a8
children 078edc1821bf
comparison
equal deleted inserted replaced
25069:ac159f43d966 25070:f397a21b3e4c
1453 static int 1453 static int
1454 yank_copy_line(struct block_def *bd, long y_idx, int exclude_trailing_space) 1454 yank_copy_line(struct block_def *bd, long y_idx, int exclude_trailing_space)
1455 { 1455 {
1456 char_u *pnew; 1456 char_u *pnew;
1457 1457
1458 if (exclude_trailing_space)
1459 bd->endspaces = 0;
1458 if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1)) 1460 if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1))
1459 == NULL) 1461 == NULL)
1460 return FAIL; 1462 return FAIL;
1461 y_current->y_array[y_idx] = pnew; 1463 y_current->y_array[y_idx] = pnew;
1462 vim_memset(pnew, ' ', (size_t)bd->startspaces); 1464 vim_memset(pnew, ' ', (size_t)bd->startspaces);
2745 2747
2746 if (init_write_reg(name, &old_y_previous, &old_y_current, must_append, 2748 if (init_write_reg(name, &old_y_previous, &old_y_current, must_append,
2747 &yank_type) == FAIL) 2749 &yank_type) == FAIL)
2748 return; 2750 return;
2749 2751
2750 str_to_reg(y_current, yank_type, (char_u *) strings, -1, block_len, TRUE); 2752 str_to_reg(y_current, yank_type, (char_u *)strings, -1, block_len, TRUE);
2751 2753
2752 finish_write_reg(name, old_y_previous, old_y_current); 2754 finish_write_reg(name, old_y_previous, old_y_current);
2753 } 2755 }
2754 2756
2755 void 2757 void