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.
This commit is contained in:
Bram Moolenaar
2022-06-30 12:30:19 +01:00
parent b0375d466e
commit d25f003342
3 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
11,
/**/
10,
/**/