To: vim_dev@googlegroups.com Subject: Patch 8.0.0091 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0091 Problem: Test_help_complete sometimes fails in MS-Windows console. Solution: Use getcompletion() instead of feedkeys() and command line completion. (Hirohito Higashi) Files: src/testdir/test_help_tagjump.vim *** ../vim-8.0.0090/src/testdir/test_help_tagjump.vim 2016-08-18 22:59:47.000000000 +0200 --- src/testdir/test_help_tagjump.vim 2016-11-17 19:38:16.806536964 +0100 *************** *** 77,93 **** endif endfunc ! func s:get_cmd_compl_list(cmd) ! let list = [] ! let str = '' ! for cnt in range(1, 999) ! call feedkeys(a:cmd . repeat("\", cnt) . "'\let str='\", 'tx') ! if str ==# a:cmd[1:] ! break ! endif ! call add(list, str) ! endfor ! return list endfunc func Test_help_complete() --- 77,84 ---- endif endfunc ! func s:get_help_compl_list(cmd) ! return getcompletion(a:cmd, 'help') endfunc func Test_help_complete() *************** *** 99,147 **** 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) 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) " '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)) " '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)) " '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)) " '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)) " '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)) endif catch call assert_exception('X') --- 90,138 ---- if has('multi_lang') set helplang= endif ! 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_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_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_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_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_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_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') *** ../vim-8.0.0090/src/version.c 2016-11-17 19:32:17.901024218 +0100 --- src/version.c 2016-11-17 19:42:02.032924245 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 91, /**/ -- hundred-and-one symptoms of being an internet addict: 29. Your phone bill comes to your doorstep in a box. /// 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 ///