Hi Bram,

2016-11-16(Wed) 6:01:31 UTC+9 Bram Moolenaar:
> Hirohito Higashi wrote:
> 
> 
> 
> > Hi Matt, Bram and list!
> 
> > 
> 
> > 2016-11-9(Wed) 6:00:50 UTC+9 Matt Gardner:
> 
> > > I applied the patch and tested it in a few situations, and it looks to me 
> > > like it fixed the problem.  Thanks!
> 
> > 
> 
> > Thanks for confirming my patch.
> 
> > 
> 
> > Bram>
> 
> > Are there concerns about my patch?
> 
> > (I feel somehow you are busy now :-)
> 
> 
> 
> It's near the top of the todo list.
> 
> 
> 
> Yeah, busy.  Still send out a couple of patches each day.  Crashes have

Please keep your good health. ( ˘ω˘)

> 
> priority.  And wasted time on trying to figure out this problem:
> 
> 
> 
> Test_help_complete sometimes fails on MS-Windows:
> 
> function RunTheTest[9]..Test_help_complete line 22: Expected ['h 
> test-char@ab',
> 
> 'h test-char@en', 'h test-col@ab', 'h test-col@en'] but got ['h 
> test-char@en', '
> 
> h test-char@en\t', 'h test-col@ab', 'h test-col@en']
> 
> Appears to be related to calling feedkeys() with exactly 8 characters.
> 
> 
> 
> Only happens in console version.  My MSVC debugger stopped working, it's
> 
> a bit difficult to figure this out without a debugger...

I can't reproduce it on my environment.
However, I am happy if you can adopt one of the following three patch.

Patch 1: I heard from Taro Muraoka ...
"It seems to be stable if you insert `sleep 100m` before 
s:get_cmd_compl_list()."

diff --git a/src/testdir/test_help_tagjump.vim 
b/src/testdir/test_help_tagjump.vim
index 778bd9c..2fe57ef 100644
--- a/src/testdir/test_help_tagjump.vim
+++ b/src/testdir/test_help_tagjump.vim
@@ -111,6 +111,7 @@ func Test_help_complete()
       " 'helplang=' and help file lang is 'en' and 'ab'
       set rtp+=Xdir1/doc-ab
       set helplang=
+      sleep 100m
       let list = s:get_cmd_compl_list(":h test")
       call assert_equal(sort(['h test-col@en', 'h test-col@ab',
             \             'h test-char@en', 'h test-char@ab']), sort(list))


~~~~
Patch 2: Use `c_CTRL-A` instead of loops and `c_CTRL-B`.
Attached patch: p2_maybe_fix_help_complete_problem.patch

~~~~
Patch 3: Use getcompletion() function.
Attached patch: p3_maybe_fix_help_complete_problem.patch

--
Best regards,
Hirohito Higashi (a.k.a. h_east)

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/test_help_tagjump.vim b/src/testdir/test_help_tagjump.vim
index 778bd9c..d088f5a 100644
--- a/src/testdir/test_help_tagjump.vim
+++ b/src/testdir/test_help_tagjump.vim
@@ -78,16 +78,8 @@ func s:doc_config_teardown()
 endfunc
 
 func s:get_cmd_compl_list(cmd)
-  let list = []
-  let str = ''
-  for cnt in range(1, 999)
-    call feedkeys(a:cmd . repeat("\<Tab>", cnt) . "'\<C-B>let str='\<CR>", 'tx')
-    if str ==# a:cmd[1:]
-      break
-    endif
-    call add(list, str)
-  endfor
-  return list
+  call feedkeys(a:cmd . "\<C-A>'\<C-B>let str='\<CR>", 'tx')
+  return filter(split(str), 'v:val !=# "h"')
 endfunc
 
 func Test_help_complete()
@@ -100,48 +92,48 @@ func Test_help_complete()
       set helplang=
     endif
     let list = s:get_cmd_compl_list(":h test")
-    call assert_equal(['h test-col', 'h test-char'], list)
+    call assert_equal(['test-col', 'test-char'], list)
 
     if has('multi_lang')
       " 'helplang=ab' and help file lang is 'en'
       set helplang=ab
       let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(['h test-col', 'h test-char'], list)
+      call assert_equal(['test-col', 'test-char'], list)
 
       " 'helplang=' and help file lang is 'en' and 'ab'
       set rtp+=Xdir1/doc-ab
       set helplang=
       let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col@en', 'h test-col@ab',
-            \             'h test-char@en', 'h test-char@ab']), sort(list))
+      call assert_equal(sort(['test-col@en', 'test-col@ab',
+            \             'test-char@en', 'test-char@ab']), sort(list))
 
       " 'helplang=ab' and help file lang is 'en' and 'ab'
       set helplang=ab
       let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col', 'h test-col@en',
-            \             'h test-char', 'h test-char@en']), sort(list))
+      call assert_equal(sort(['test-col', 'test-col@en',
+            \             'test-char', 'test-char@en']), sort(list))
 
       " 'helplang=' and help file lang is 'en', 'ab' and 'ja'
       set rtp+=Xdir1/doc-ja
       set helplang=
       let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col@en', 'h test-col@ab',
-            \             'h test-col@ja', 'h test-char@en',
-            \             'h test-char@ab', 'h test-char@ja']), sort(list))
+      call assert_equal(sort(['test-col@en', 'test-col@ab',
+            \             'test-col@ja', 'test-char@en',
+            \             'test-char@ab', 'test-char@ja']), sort(list))
 
       " 'helplang=ab' and help file lang is 'en', 'ab' and 'ja'
       set helplang=ab
       let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col', 'h test-col@en',
-            \             'h test-col@ja', 'h test-char',
-            \             'h test-char@en', 'h test-char@ja']), sort(list))
+      call assert_equal(sort(['test-col', 'test-col@en',
+            \             'test-col@ja', 'test-char',
+            \             'test-char@en', 'test-char@ja']), sort(list))
 
       " 'helplang=ab,ja' and help file lang is 'en', 'ab' and 'ja'
       set helplang=ab,ja
       let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col', 'h test-col@ja',
-            \             'h test-col@en', 'h test-char',
-            \             'h test-char@ja', 'h test-char@en']), sort(list))
+      call assert_equal(sort(['test-col', 'test-col@ja',
+            \             'test-col@en', 'test-char',
+            \             'test-char@ja', 'test-char@en']), sort(list))
     endif
   catch
     call assert_exception('X')
diff --git a/src/testdir/test_help_tagjump.vim b/src/testdir/test_help_tagjump.vim
index 778bd9c..d11a1fa 100644
--- a/src/testdir/test_help_tagjump.vim
+++ b/src/testdir/test_help_tagjump.vim
@@ -77,17 +77,8 @@ func s:doc_config_teardown()
   endif
 endfunc
 
-func s:get_cmd_compl_list(cmd)
-  let list = []
-  let str = ''
-  for cnt in range(1, 999)
-    call feedkeys(a:cmd . repeat("\<Tab>", cnt) . "'\<C-B>let str='\<CR>", 'tx')
-    if str ==# a:cmd[1:]
-      break
-    endif
-    call add(list, str)
-  endfor
-  return list
+func s:get_help_compl_list(cmd)
+  return getcompletion(a:cmd, 'help')
 endfunc
 
 func Test_help_complete()
@@ -99,49 +90,49 @@ func Test_help_complete()
     if has('multi_lang')
       set helplang=
     endif
-    let list = s:get_cmd_compl_list(":h test")
-    call assert_equal(['h test-col', 'h test-char'], list)
+    let list = s:get_help_compl_list("test")
+    call assert_equal(['test-col', 'test-char'], list)
 
     if has('multi_lang')
       " 'helplang=ab' and help file lang is 'en'
       set helplang=ab
-      let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(['h test-col', 'h test-char'], list)
+      let list = s:get_help_compl_list("test")
+      call assert_equal(['test-col', 'test-char'], list)
 
       " 'helplang=' and help file lang is 'en' and 'ab'
       set rtp+=Xdir1/doc-ab
       set helplang=
-      let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col@en', 'h test-col@ab',
-            \             'h test-char@en', 'h test-char@ab']), sort(list))
+      let list = s:get_help_compl_list("test")
+      call assert_equal(sort(['test-col@en', 'test-col@ab',
+            \             'test-char@en', 'test-char@ab']), sort(list))
 
       " 'helplang=ab' and help file lang is 'en' and 'ab'
       set helplang=ab
-      let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col', 'h test-col@en',
-            \             'h test-char', 'h test-char@en']), sort(list))
+      let list = s:get_help_compl_list("test")
+      call assert_equal(sort(['test-col', 'test-col@en',
+            \             'test-char', 'test-char@en']), sort(list))
 
       " 'helplang=' and help file lang is 'en', 'ab' and 'ja'
       set rtp+=Xdir1/doc-ja
       set helplang=
-      let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col@en', 'h test-col@ab',
-            \             'h test-col@ja', 'h test-char@en',
-            \             'h test-char@ab', 'h test-char@ja']), sort(list))
+      let list = s:get_help_compl_list("test")
+      call assert_equal(sort(['test-col@en', 'test-col@ab',
+            \             'test-col@ja', 'test-char@en',
+            \             'test-char@ab', 'test-char@ja']), sort(list))
 
       " 'helplang=ab' and help file lang is 'en', 'ab' and 'ja'
       set helplang=ab
-      let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col', 'h test-col@en',
-            \             'h test-col@ja', 'h test-char',
-            \             'h test-char@en', 'h test-char@ja']), sort(list))
+      let list = s:get_help_compl_list("test")
+      call assert_equal(sort(['test-col', 'test-col@en',
+            \             'test-col@ja', 'test-char',
+            \             'test-char@en', 'test-char@ja']), sort(list))
 
       " 'helplang=ab,ja' and help file lang is 'en', 'ab' and 'ja'
       set helplang=ab,ja
-      let list = s:get_cmd_compl_list(":h test")
-      call assert_equal(sort(['h test-col', 'h test-col@ja',
-            \             'h test-col@en', 'h test-char',
-            \             'h test-char@ja', 'h test-char@en']), sort(list))
+      let list = s:get_help_compl_list("test")
+      call assert_equal(sort(['test-col', 'test-col@ja',
+            \             'test-col@en', 'test-char',
+            \             'test-char@ja', 'test-char@en']), sort(list))
     endif
   catch
     call assert_exception('X')

Raspunde prin e-mail lui