patch 8.2.3454: using a count with "gp" leave cursor in wrong position

Problem:    Using a count with "gp" leave cursor in wrong position. (Naohiro
            Ono)
Solution:   Count the inserted lines. (closes #8899)
diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim
index 3d4c5e7..f034336 100644
--- a/src/testdir/test_put.vim
+++ b/src/testdir/test_put.vim
@@ -122,4 +122,14 @@
   close!
 endfunc
 
+func Test_gp_with_count_leaves_cursor_at_end()
+  new
+  call setline(1, '<---->')
+  call setreg('@', "foo\nbar", 'c')
+  exe "normal 1G3|3gpix\<Esc>"
+  call assert_equal(['<--foo', 'barfoo', 'barfoo', 'barx-->'], getline(1, '$'))
+
+  bwipe!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab