Patch 8.2.4319
Problem:    :put does not work properly in compiled function. (John Beckett)
Solution:   Adjust the direction when using line zero.
Files:      src/vim9execute.c, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.4318/src/vim9execute.c   2022-02-06 13:54:59.236437901 +0000
--- src/vim9execute.c   2022-02-07 15:08:43.619872293 +0000
***************
*** 4617,4623 ****
                        // :put! above cursor
                        dir = BACKWARD;
                    else if (lnum >= 0)
!                       curwin->w_cursor.lnum = iptr->isn_arg.put.put_lnum;
  
                    if (regname == '=')
                    {
--- 4617,4628 ----
                        // :put! above cursor
                        dir = BACKWARD;
                    else if (lnum >= 0)
!                   {
!                       curwin->w_cursor.lnum = lnum;
!                       if (lnum == 0)
!                           // check_cursor() below will move to line 1
!                           dir = BACKWARD;
!                   }
  
                    if (regname == '=')
                    {
*** ../vim-8.2.4318/src/testdir/test_vim9_cmd.vim       2022-02-04 
21:17:54.412950056 +0000
--- src/testdir/test_vim9_cmd.vim       2022-02-07 15:22:15.598343244 +0000
***************
*** 1156,1162 ****
--- 1156,1168 ----
    :2put =['a', 'b', 'c']
    assert_equal(['ppp', 'a', 'b', 'c', 'above'], getline(2, 6))
  
+   :0put ='first'
+   assert_equal('first', getline(1))
+   :1put! ='first again'
+   assert_equal('first again', getline(1))
+ 
    # compute range at runtime
+   :%del
    setline(1, range(1, 8))
    @a = 'aaa'
    :$-2put a
*** ../vim-8.2.4318/src/version.c       2022-02-07 13:56:40.596793019 +0000
--- src/version.c       2022-02-07 15:11:41.411467861 +0000
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4319,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
22. You've already visited all the links at Yahoo and you're halfway through
    Lycos.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220207153326.8E3CE1C071D%40moolenaar.net.

Raspunde prin e-mail lui