To: vim_dev@googlegroups.com Subject: Patch 8.2.5152 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.5152 Problem: search() gets stuck with "c" and skip evaluates to true. Solution: Reset the SEARCH_START option. (closes #10608) Files: src/evalfunc.c, src/testdir/test_syntax.vim *** ../vim-8.2.5151/src/evalfunc.c 2022-06-16 21:20:43.392236854 +0100 --- src/evalfunc.c 2022-06-23 11:55:51.540965568 +0100 *************** *** 8543,8548 **** --- 8543,8551 ---- if (!do_skip) break; } + + // clear the start flag to avoid getting stuck here + options &= ~SEARCH_START; } if (subpatnum != FAIL) *** ../vim-8.2.5151/src/testdir/test_syntax.vim 2022-06-18 16:05:28.864632946 +0100 --- src/testdir/test_syntax.vim 2022-06-23 12:03:23.156728078 +0100 *************** *** 838,845 **** 1 call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"') call assert_equal('Another Text for VIM', getline('.')) 1 ! call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") !~? "string"') call assert_equal(' let a = "VIM"', getline('.')) " Skip argument using Lambda. --- 838,846 ---- 1 call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"') call assert_equal('Another Text for VIM', getline('.')) + 1 ! call search('VIM', 'cw', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") !~? "string"') call assert_equal(' let a = "VIM"', getline('.')) " Skip argument using Lambda. *************** *** 848,873 **** call assert_equal('Another Text for VIM', getline('.')) 1 ! call search('VIM', 'w', '', 0, { -> synIDattr(synID(line("."), col("."), 1), "name") !~? "string"}) call assert_equal(' let a = "VIM"', getline('.')) " Skip argument using funcref. func InComment() return synIDattr(synID(line("."), col("."), 1), "name") =~? "comment" endfunc ! func InString() return synIDattr(synID(line("."), col("."), 1), "name") !~? "string" endfunc 1 call search('VIM', 'w', '', 0, function('InComment')) call assert_equal('Another Text for VIM', getline('.')) 1 ! call search('VIM', 'w', '', 0, function('InString')) call assert_equal(' let a = "VIM"', getline('.')) delfunc InComment ! delfunc InString bwipe! endfunc --- 849,875 ---- call assert_equal('Another Text for VIM', getline('.')) 1 ! call search('VIM', 'cw', '', 0, { -> synIDattr(synID(line("."), col("."), 1), "name") !~? "string"}) call assert_equal(' let a = "VIM"', getline('.')) " Skip argument using funcref. func InComment() return synIDattr(synID(line("."), col("."), 1), "name") =~? "comment" endfunc ! func NotInString() return synIDattr(synID(line("."), col("."), 1), "name") !~? "string" endfunc + 1 call search('VIM', 'w', '', 0, function('InComment')) call assert_equal('Another Text for VIM', getline('.')) 1 ! call search('VIM', 'cw', '', 0, function('NotInString')) call assert_equal(' let a = "VIM"', getline('.')) delfunc InComment ! delfunc NotInString bwipe! endfunc *** ../vim-8.2.5151/src/version.c 2022-06-22 19:59:24.711499746 +0100 --- src/version.c 2022-06-23 11:57:20.687842424 +0100 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 5152, /**/ -- Article in the first Free Software Magazine: "Bram Moolenaar studied electrical engineering at the Technical University of Delft and graduated in 1985 on a multi-processor Unix architecture." Response by "dimator": Could the school not afford a proper stage for the ceremony? /// 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 ///