File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,21 @@ function! Test_hlsearch()
3232 call getchar (1 )
3333 enew !
3434endfunction
35+
36+ func Test_hlsearch_hangs ()
37+ if ! has (' reltime' ) || ! has (' float' )
38+ return
39+ endif
40+
41+ " This pattern takes forever to match, it should timeout.
42+ help
43+ let start = reltime ()
44+ set hlsearch nolazyredraw redrawtime = 101
45+ let @/ = ' \%#=2\v(a|\1)*'
46+ redraw
47+ let elapsed = reltimefloat (reltime (start ))
48+ call assert_true (elapsed > 0.1 )
49+ call assert_true (elapsed < 1.0 )
50+ set nohlsearch redrawtime &
51+ quit
52+ endfunc
Original file line number Diff line number Diff line change @@ -764,6 +764,8 @@ static char *(features[]) =
764764
765765static int included_patches [] =
766766{ /* Add new patch number below this line */
767+ /**/
768+ 644 ,
767769/**/
768770 643 ,
769771/**/
You can’t perform that action at this time.
0 commit comments