Hi, I also faced the same issue.
2020/1/28 Tue 19:18:26 UTC+9 Bram Moolenaar wrote: > > > Michael Soyka wrote: > > > Builtin function feedinput is called in Test_range, file > > testdir/test_functions.vim. This function works only with +unix or GUI > is > > running. Calling this function will cause vim.exe (without GUI) to > lockup > > (Windows 10). > > > > I've not used "CheckUnix" and "CheckGui" in the attached patch so that > the > > throw message is not misleading. > > Can you try if using feedkeys() instead of test_feedinput() works? > We don't need a very low-level input here. > > Alternatively, this mechanism should work like it's done in > Test_inputlist(): > > call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. > green', '3. blue'])\<cr>1\<cr>", 'tx') I tried it locally and it worked fine. I also find another issue related to this. * When vim.exe is compiled with VIMDLL, test_feedinput() causes an infinite loop. gui.in_use should be checked. * Call of json_encode() was not in the alphabetical order. Sort it and add a comment. Please check the attached patch. Regards, Ken Takata -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/607efec4-bb56-452d-aa76-110b40adac47%40googlegroups.com.
# HG changeset patch # Parent 784e3f41d80510bc75551c73a38555084112f746 diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -1849,12 +1849,10 @@ func Test_range() call assert_equal(1, index(range(1, 5), 2)) " inputlist() - call test_feedinput("1\<CR>") - call assert_equal(1, inputlist(range(10))) - call test_feedinput("1\<CR>") - call assert_equal(1, inputlist(range(3, 10))) - - call assert_equal('[0,1,2,3]', json_encode(range(4))) + call feedkeys(":let result = inputlist(range(10))\<CR>1\<CR>", 'x') + call assert_equal(1, result) + call feedkeys(":let result = inputlist(range(3, 10))\<CR>1\<CR>", 'x') + call assert_equal(1, result) " insert() call assert_equal([42, 1, 2, 3, 4, 5], insert(range(1, 5), 42)) @@ -1867,6 +1865,9 @@ func Test_range() " join() call assert_equal('0 1 2 3 4', join(range(5))) + " json_encode() + call assert_equal('[0,1,2,3]', json_encode(range(4))) + " len() call assert_equal(0, len(range(0))) call assert_equal(2, len(range(2))) diff --git a/src/testing.c b/src/testing.c --- a/src/testing.c +++ b/src/testing.c @@ -640,6 +640,11 @@ f_test_feedinput(typval_T *argvars, typv #ifdef USE_INPUT_BUF char_u *val = tv_get_string_chk(&argvars[0]); +# ifdef VIMDLL + if (!gui.in_use) + return; +# endif + if (val != NULL) { trash_input_buf();