Patch 9.0.0765
Problem:    With a Visual block a put command column may go negative.
Solution:   Check that the column does not become negative.
Files:      src/register.c, src/testdir/test_visual.vim


*** ../vim-9.0.0764/src/register.c      2022-10-01 19:43:48.610494062 +0100
--- src/register.c      2022-10-15 19:01:46.556628619 +0100
***************
*** 1960,1965 ****
--- 1960,1967 ----
        // adjust '] mark
        curbuf->b_op_end.lnum = curwin->w_cursor.lnum - 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;
        if (flags & PUT_CURSEND)
        {
*** ../vim-9.0.0764/src/testdir/test_visual.vim 2022-10-09 11:44:22.953119184 
+0100
--- src/testdir/test_visual.vim 2022-10-15 19:00:10.216652277 +0100
***************
*** 483,488 ****
--- 483,500 ----
    bw!
  endfunc
  
+ func Test_visual_block_put_invalid()
+   enew!
+   behave mswin
+   norm yy
+   norm v)P s/^/       
+   " 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
  func Test_visual_mode_op()
    new
*** ../vim-9.0.0764/src/version.c       2022-10-15 16:41:49.780490432 +0100
--- src/version.c       2022-10-15 19:02:56.048608761 +0100
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     765,
  /**/

-- 
VOICE OVER: As the horrendous Black Beast lunged forward, escape for Arthur
            and his knights seemed hopeless,  when, suddenly ... the animator
            suffered a fatal heart attack.
ANIMATOR:   Aaaaagh!
VOICE OVER: The cartoon peril was no more ... The Quest for Holy Grail could
            continue.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221015180521.B9ECB1C11B0%40moolenaar.net.

Raspunde prin e-mail lui