To: vim_dev@googlegroups.com Subject: Patch 8.2.4319 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///