mirror of
https://github.com/vim/vim.git
synced 2025-07-24 10:45:12 -04:00
patch 8.2.4219: reading before the start of the line
Problem: Reading before the start of the line. Solution: Check boundary before trying to read the character.
This commit is contained in:
parent
806d037671
commit
44db8213d3
@ -1474,7 +1474,7 @@ yank_copy_line(struct block_def *bd, long y_idx, int exclude_trailing_space)
|
|||||||
{
|
{
|
||||||
int s = bd->textlen + bd->endspaces;
|
int s = bd->textlen + bd->endspaces;
|
||||||
|
|
||||||
while (VIM_ISWHITE(*(bd->textstart + s - 1)) && s > 0)
|
while (s > 0 && VIM_ISWHITE(*(bd->textstart + s - 1)))
|
||||||
{
|
{
|
||||||
s = s - (*mb_head_off)(bd->textstart, bd->textstart + s - 1) - 1;
|
s = s - (*mb_head_off)(bd->textstart, bd->textstart + s - 1) - 1;
|
||||||
pnew--;
|
pnew--;
|
||||||
|
@ -1247,6 +1247,13 @@ func Test_visual_put_blockedit_zy_and_zp()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_visual_block_yank_zy()
|
||||||
|
new
|
||||||
|
" this was reading before the start of the line
|
||||||
|
exe "norm o\<C-T>\<Esc>\<C-V>zy"
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_visual_block_with_virtualedit()
|
func Test_visual_block_with_virtualedit()
|
||||||
CheckScreendump
|
CheckScreendump
|
||||||
|
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4219,
|
||||||
/**/
|
/**/
|
||||||
4218,
|
4218,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user