To: vim_dev@googlegroups.com Subject: Patch 8.0.0644 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0644 Problem: There is no test for 'hlsearch' timing out. Solution: Add a test. Files: src/testdir/test_hlsearch.vim *** ../vim-8.0.0643/src/testdir/test_hlsearch.vim 2016-09-07 20:37:01.000000000 +0200 --- src/testdir/test_hlsearch.vim 2017-06-17 19:12:54.857318714 +0200 *************** *** 32,34 **** --- 32,52 ---- call getchar(1) enew! endfunction + + func Test_hlsearch_hangs() + if !has('reltime') || !has('float') + return + endif + + " This pattern takes forever to match, it should timeout. + help + let start = reltime() + set hlsearch nolazyredraw redrawtime=101 + let @/ = '\%#=2\v(a|\1)*' + redraw + let elapsed = reltimefloat(reltime(start)) + call assert_true(elapsed > 0.1) + call assert_true(elapsed < 1.0) + set nohlsearch redrawtime& + quit + endfunc *** ../vim-8.0.0643/src/version.c 2017-06-17 18:44:17.010000862 +0200 --- src/version.c 2017-06-17 19:05:43.096482434 +0200 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 644, /**/ -- Never overestimate a man's ability to underestimate a woman. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///