changeset 29336:575bc8eaa593 v9.0.0011

patch 9.0.0011: reading beyond the end of the line with put command Commit: https://github.com/vim/vim/commit/d25f003342aca9889067f2e839963dfeccf1fe05 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 30 12:30:19 2022 +0100 patch 9.0.0011: reading beyond the end of the line with put command Problem: Reading beyond the end of the line with put command. Solution: Adjust the end mark position.
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 Jun 2022 13:45:03 +0200
parents bd9c610a156d
children 2987bdf4f6cc
files src/register.c src/testdir/test_put.vim src/version.c
diffstat 3 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/register.c
+++ b/src/register.c
@@ -1918,6 +1918,8 @@ do_put(
 		    vim_memset(ptr, ' ', (size_t)spaces);
 		    ptr += spaces;
 		}
+		else
+		    totlen -= spaces;  // didn't use these spaces
 	    }
 
 	    // may insert some spaces after the new text
--- a/src/testdir/test_put.vim
+++ b/src/testdir/test_put.vim
@@ -219,5 +219,17 @@ func Test_put_empty_register()
   bwipe!
 endfunc
 
+" this was putting the end mark after the end of the line
+func Test_put_visual_mode()
+  edit! SomeNewBuffer
+  set selection=exclusive
+  exe "norm o\t"
+  m0
+  sil! norm 
p
p
+
+  bwipe!
+  set selection&
+endfunc
+
 
 " vim: shiftwidth=2 sts=2 expandtab
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    11,
+/**/
     10,
 /**/
     9,