2 Upstream-Status: Backport
3 Signed-off-by: Ross Burton <ross.burton@arm.com>
5 From 93b427c6e729260d0700c3b2804ec153bc8284fa Mon Sep 17 00:00:00 2001
6 From: Bram Moolenaar <Bram@vim.org>
7 Date: Thu, 4 Nov 2021 15:10:11 +0000
8 Subject: [PATCH] patch 8.2.3581: reading character past end of line
10 Problem: Reading character past end of line.
11 Solution: Correct the cursor column.
14 src/testdir/test_put.vim | 12 ++++++++++++
16 3 files changed, 15 insertions(+)
18 diff --git a/src/ex_docmd.c b/src/ex_docmd.c
19 index fde726477..59e245bee 100644
22 @@ -6905,6 +6905,7 @@ ex_put(exarg_T *eap)
25 curwin->w_cursor.lnum = eap->line2;
27 do_put(eap->regname, eap->forceit ? BACKWARD : FORWARD, 1L,
28 PUT_LINE|PUT_CURSLINE);
30 diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim
31 index 225ebd1f3..922e5b269 100644
32 --- a/src/testdir/test_put.vim
33 +++ b/src/testdir/test_put.vim
34 @@ -113,3 +113,15 @@ func Test_put_p_indent_visual()
35 call assert_equal('select that text', getline(2))
39 +func Test_put_above_first_line()
44 + call assert_equal('text', getline(1))
49 +" vim: shiftwidth=2 sts=2 expandtab
50 diff --git a/src/version.c b/src/version.c
51 index a9e8be0e7..df4ec9a47 100644
54 @@ -742,6 +742,8 @@ static char *(features[]) =
56 static int included_patches[] =
57 { /* Add new patch number below this line */