summaryrefslogtreecommitdiff
path: root/src/vim9execute.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-07 15:31:37 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-07 15:31:37 +0000
commit4e713bafc0ae191b1830e3cd3c323ebd695bc3a1 (patch)
tree3bed62959c3a127b5d9b52a16d65f170265a9285 /src/vim9execute.c
parent54969f4ef5825205ecde09ea80f4087fc3b68e5d (diff)
downloadvim-git-8.2.4319.tar.gz
patch 8.2.4319: :put does not work properly in compiled functionv8.2.4319
Problem: :put does not work properly in compiled function. (John Beckett) Solution: Adjust the direction when using line zero.
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r--src/vim9execute.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 6c79ff7df..961e4507c 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -4617,7 +4617,12 @@ exec_instructions(ectx_T *ectx)
// :put! above cursor
dir = BACKWARD;
else if (lnum >= 0)
- curwin->w_cursor.lnum = iptr->isn_arg.put.put_lnum;
+ {
+ curwin->w_cursor.lnum = lnum;
+ if (lnum == 0)
+ // check_cursor() below will move to line 1
+ dir = BACKWARD;
+ }
if (regname == '=')
{