mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
vim-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 vim/vim#8468, closes vim/vim#8448)7d7bcc6ba0
N/A patches for version.c: vim-patch:8.2.3075: xxd always reports an old version string Problem: Xxd always reports an old version string. (Åsmund Ervik) Solution: Update the version string with the last known change date. (Jürgen Weigert, closes vim/vim#8475)80b2ba3e96
This commit is contained in:
@@ -2719,10 +2719,13 @@ static void op_yank_reg(oparg_T *oap, bool message, yankreg_T *reg, bool append)
|
|||||||
|
|
||||||
// Copy a block range into a register.
|
// Copy a block range into a register.
|
||||||
// If "exclude_trailing_space" is set, do not copy trailing whitespaces.
|
// If "exclude_trailing_space" is set, do not copy trailing whitespaces.
|
||||||
static void yank_copy_line(yankreg_T *reg, const struct block_def *bd,
|
static void yank_copy_line(yankreg_T *reg, struct block_def *bd,
|
||||||
size_t y_idx, bool exclude_trailing_space)
|
size_t y_idx, bool exclude_trailing_space)
|
||||||
FUNC_ATTR_NONNULL_ALL
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
|
if (exclude_trailing_space) {
|
||||||
|
bd->endspaces = 0;
|
||||||
|
}
|
||||||
int size = bd->startspaces + bd->endspaces + bd->textlen;
|
int size = bd->startspaces + bd->endspaces + bd->textlen;
|
||||||
assert(size >= 0);
|
assert(size >= 0);
|
||||||
char_u *pnew = xmallocz((size_t)size);
|
char_u *pnew = xmallocz((size_t)size);
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
" Tests for various Visual modes.
|
" Tests for various Visual modes.
|
||||||
|
|
||||||
|
source shared.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func Test_block_shift_multibyte()
|
func Test_block_shift_multibyte()
|
||||||
" Uses double-wide character.
|
" Uses double-wide character.
|
||||||
split
|
split
|
||||||
@@ -1060,5 +1063,24 @@ func Test_visual_put_in_block_using_zy_and_zp()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_visual_put_blockedit_zy_and_zp()
|
||||||
|
new
|
||||||
|
|
||||||
|
call setline(1, ['aa', 'bbbbb', 'ccc', '', 'XX', 'GGHHJ', 'RTZU'])
|
||||||
|
exe "normal! gg0\<c-v>2j$zy"
|
||||||
|
norm! 5gg0zP
|
||||||
|
call assert_equal(['aa', 'bbbbb', 'ccc', '', 'aaXX', 'bbbbbGGHHJ', 'cccRTZU'], getline(1, 7))
|
||||||
|
"
|
||||||
|
" now with blockmode editing
|
||||||
|
sil %d
|
||||||
|
:set ve=block
|
||||||
|
call setline(1, ['aa', 'bbbbb', 'ccc', '', 'XX', 'GGHHJ', 'RTZU'])
|
||||||
|
exe "normal! gg0\<c-v>2j$zy"
|
||||||
|
norm! 5gg0zP
|
||||||
|
call assert_equal(['aa', 'bbbbb', 'ccc', '', 'aaXX', 'bbbbbGGHHJ', 'cccRTZU'], getline(1, 7))
|
||||||
|
set ve&vim
|
||||||
|
bw!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user