Skip to content

Commit

Permalink
patch 8.2.3581: reading character past end of line
Browse files Browse the repository at this point in the history
Problem:    Reading character past end of line.
Solution:   Correct the cursor column.
  • Loading branch information
brammool committed Nov 4, 2021
1 parent aaec1d4 commit 0b5b06c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ex_docmd.c
Expand Up @@ -7774,6 +7774,7 @@ ex_put(exarg_T *eap)
eap->forceit = TRUE;
}
curwin->w_cursor.lnum = eap->line2;
check_cursor_col();
do_put(eap->regname, NULL, eap->forceit ? BACKWARD : FORWARD, 1L,
PUT_LINE|PUT_CURSLINE);
}
Expand Down
9 changes: 9 additions & 0 deletions src/testdir/test_put.vim
Expand Up @@ -159,5 +159,14 @@ func Test_very_large_count()
bwipe!
endfunc

func Test_put_above_first_line()
new
let @" = 'text'
silent! normal 0o00
0put
call assert_equal('text', getline(1))
bwipe!
endfunc


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

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

0 comments on commit 0b5b06c

Please sign in to comment.