summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-09-22 16:43:59 +0200
committerBram Moolenaar <Bram@vim.org>2021-09-22 16:43:59 +0200
commit56858e4ed4e338e15821767b8303b06099e40384 (patch)
treedff07aafa059046517f533e2d278c1a66b258140
parent23003e51e18371afda4420d9e171a3dcba5a31cc (diff)
patch 8.2.3455: using a count with "gp" leaves '] in wrong positionv8.2.3455
Problem: Using a count with "gp" leaves '] in wrong position. (Naohiro Ono) Solution: Correct the mark position. (closes #8899)
-rw-r--r--src/register.c3
-rw-r--r--src/testdir/test_put.vim6
-rw-r--r--src/version.c2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/register.c b/src/register.c
index 3ddacb8ee4..f034c645b0 100644
--- a/src/register.c
+++ b/src/register.c
@@ -2205,6 +2205,9 @@ error:
{
curwin->w_cursor.lnum = new_lnum;
curwin->w_cursor.col = col;
+ curbuf->b_op_end = curwin->w_cursor;
+ if (col > 1)
+ curbuf->b_op_end.col = col - 1;
}
}
else if (y_type == MLINE)
diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim
index f034336286..f3a320f463 100644
--- a/src/testdir/test_put.vim
+++ b/src/testdir/test_put.vim
@@ -126,8 +126,10 @@ 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, '$'))
+ normal 1G3|3gp
+ call assert_equal([0, 4, 4, 0], getpos("."))
+ call assert_equal(['<--foo', 'barfoo', 'barfoo', 'bar-->'], getline(1, '$'))
+ call assert_equal([0, 4, 3, 0], getpos("']"))
bwipe!
endfunc
diff --git a/src/version.c b/src/version.c
index fb36b14a13..6865fa5c5b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3455,
+/**/
3454,
/**/
3453,