mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.0765: with a Visual block a put command column may go negative
Problem: With a Visual block a put command column may go negative. Solution: Check that the column does not become negative.
This commit is contained in:
@@ -1960,6 +1960,8 @@ do_put(
|
|||||||
// adjust '] mark
|
// adjust '] mark
|
||||||
curbuf->b_op_end.lnum = curwin->w_cursor.lnum - 1;
|
curbuf->b_op_end.lnum = curwin->w_cursor.lnum - 1;
|
||||||
curbuf->b_op_end.col = bd.textcol + totlen - 1;
|
curbuf->b_op_end.col = bd.textcol + totlen - 1;
|
||||||
|
if (curbuf->b_op_end.col < 0)
|
||||||
|
curbuf->b_op_end.col = 0;
|
||||||
curbuf->b_op_end.coladd = 0;
|
curbuf->b_op_end.coladd = 0;
|
||||||
if (flags & PUT_CURSEND)
|
if (flags & PUT_CURSEND)
|
||||||
{
|
{
|
||||||
|
@@ -483,6 +483,18 @@ func Test_visual_block_put()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_visual_block_put_invalid()
|
||||||
|
enew!
|
||||||
|
behave mswin
|
||||||
|
norm yy
|
||||||
|
norm v)Ps/^/
|
||||||
|
" this was causing the column to become negative
|
||||||
|
silent norm ggv)P
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
behave xterm
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Visual modes (v V CTRL-V) followed by an operator; count; repeating
|
" Visual modes (v V CTRL-V) followed by an operator; count; repeating
|
||||||
func Test_visual_mode_op()
|
func Test_visual_mode_op()
|
||||||
new
|
new
|
||||||
|
@@ -695,6 +695,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 */
|
||||||
|
/**/
|
||||||
|
765,
|
||||||
/**/
|
/**/
|
||||||
764,
|
764,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user