Navigation Menu

Skip to content

Commit

Permalink
patch 9.0.0011: reading beyond the end of the line with put command
Browse files Browse the repository at this point in the history
Problem:    Reading beyond the end of the line with put command.
Solution:   Adjust the end mark position.
  • Loading branch information
brammool committed Jun 30, 2022
1 parent b0375d4 commit d25f003
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/register.c
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/testdir/test_put.vim
Expand Up @@ -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 pp

bwipe!
set selection&
endfunc


" vim: shiftwidth=2 sts=2 expandtab
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -735,6 +735,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
11,
/**/
10,
/**/
Expand Down

0 comments on commit d25f003

Please sign in to comment.