On Di, 31 Okt 2017, Christian Brabandt wrote:

> 
> On So, 29 Okt 2017, Bram Moolenaar wrote:
> 
> > Patch 8.0.1238
> > Problem:    Incremental search only shows one match.
> > Solution:   When 'incsearch' and and 'hlsearch' are both set highlight all
> >             matches. (haya14busa, closes #2198)
> > Files:      runtime/doc/options.txt, src/ex_getln.c, src/proto/search.pro,
> >             src/search.c, src/testdir/test_search.vim
> 
> It looks like the test does not work correctly on Windows. I see some 
> failures:
> https://ci.appveyor.com/project/chrisbra/vim-win32-installer/build/job/g4p49k5gh6k3nbq5
> ,----
> | From test_search.vim:
> | Found errors in Test_search_cmdline_incsearch_highlight_attr(): function 
> RunTheTest[34]..Test_search_cmdline_incsearch_highlight_attr 
> | line 28: Expected not equal to 292 function 
> RunTheTest[34]..Test_search_cmdline_incsearch_highlight_attr 
> | line 29: Expected not equal to 292 function 
> RunTheTest[34]..Test_search_cmdline_incsearch_highlight_attr 
> | line 30: Expected not equal to 292
> | TEST FAILURE NMAKE : fatal error U1077: 'if' : return code '0x1'
> `----
> 
> This test is now disabled for the vim-win32-installer build. Once it 
> builds again, I'll try to debug this test.

I debugged it a bit further. I think the problem is this line:
,----
|  call term_sendkeys(g:buf, 'i' . join(lines, "\n") . "\<esc>gg0")
`----

Sending "\<esc>" does not work. Instead it looks like it sends meta/alt 
key, e.g. it set's the high bit of the following character and therefore 
does never exit insert mode.

I don't know why this is so here is a patch, that uses a temp file as a 
workaround.


diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index b863fcbba..361df8069 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -494,13 +494,14 @@ func Test_search_cmdline_incsearch_highlight_attr()
   if h < 3
     return
   endif
-  let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], 
{'term_rows': 3})
-
   " Prepare buffer text
   let lines = ['abb vim vim vi', 'vimvivim']
-  call term_sendkeys(g:buf, 'i' . join(lines, "\n") . "\<esc>gg0")
+  call writefile(lines, 'Xsearch.txt')
+  let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', 
'Xsearch.txt'], {'term_rows': 3})
+
   call term_wait(g:buf, 200)
   call assert_equal(lines[0], term_getline(g:buf, 1))
+  call assert_equal(lines[1], term_getline(g:buf, 2))

   " Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight
   call term_sendkeys(g:buf, ":set incsearch hlsearch\<cr>")
@@ -564,6 +565,7 @@ func Test_search_cmdline_incsearch_highlight_attr()
   let attr_line2 = [a0,a0,a0,a0,a0,a0,a0,a0]
   call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 
'v:val.attr'))
   call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 
'v:val.attr'))
+  call delete('Xsearch.txt')

   bwipe!
 endfunc



Christian
-- 
Hart ist Hart. Weich ist Weich. Aber immer weich ist hart.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui