To: vim_dev@googlegroups.com Subject: Patch 9.0.0765 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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)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 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///