To: vim_dev@googlegroups.com Subject: Patch 8.2.5150 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.5150 Problem: Read past the end of the first line with ":0;'{". Solution: When on line zero check the column is valid for line one. Files: src/ex_docmd.c, src/testdir/test_cmdline.vim *** ../vim-8.2.5149/src/ex_docmd.c 2022-06-18 19:48:10.813508250 +0100 --- src/ex_docmd.c 2022-06-22 19:04:37.014520816 +0100 *************** *** 3411,3420 **** curwin->w_cursor.lnum = eap->line2; // Don't leave the cursor on an illegal line or column, but do ! // accept zero as address, so 0;/PATTERN/ works correctly. // Check the cursor position before returning. if (eap->line2 > 0) check_cursor(); need_check_cursor = TRUE; } } --- 3411,3423 ---- curwin->w_cursor.lnum = eap->line2; // Don't leave the cursor on an illegal line or column, but do ! // accept zero as address, so 0;/PATTERN/ works correctly ! // (where zero usually means to use the first line). // Check the cursor position before returning. if (eap->line2 > 0) check_cursor(); + else + check_cursor_col(); need_check_cursor = TRUE; } } *** ../vim-8.2.5149/src/testdir/test_cmdline.vim 2022-06-22 13:51:50.853604054 +0100 --- src/testdir/test_cmdline.vim 2022-06-22 19:02:12.238944557 +0100 *************** *** 808,813 **** --- 808,821 ---- call delete('Xtest.vim') endfunc + func Test_mark_from_line_zero() + " this was reading past the end of the first (empty) line + new + norm oxxxx + call assert_fails("0;'(", 'E20:') + bwipe! + endfunc + func Test_cmdline_complete_wildoptions() help call feedkeys(":tag /\\\"\", 'tx') *** ../vim-8.2.5149/src/version.c 2022-06-22 18:14:25.768740990 +0100 --- src/version.c 2022-06-22 19:06:55.186177917 +0100 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 5150, /**/ -- Sometimes you can protect millions of dollars in your budget simply by buying a bag of cookies, dropping it on the budget anylyst's desk, and saying something deeply personal such as "How was your weekend, big guy?" (Scott Adams - The Dilbert principle) /// 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 ///