To: vim_dev@googlegroups.com Subject: Patch 8.2.1988 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1988 Problem: Still in Insert mode when opening terminal popup with a mapping in Insert mode. Solution: Exit Insert mode. (closes #7295) Files: src/edit.c, src/testdir/test_terminal.vim *** ../vim-8.2.1987/src/edit.c 2020-11-12 14:20:32.017927303 +0100 --- src/edit.c 2020-11-14 21:33:09.181631482 +0100 *************** *** 1033,1038 **** --- 1033,1043 ---- case K_COMMAND: // command do_cmdline(NULL, getcmdkeycmd, NULL, 0); + #ifdef FEAT_TERMINAL + if (term_use_loop()) + // Started a terminal that gets the input, exit Insert mode. + goto doESCkey; + #endif break; case K_CURSORHOLD: // Didn't type something for a while. *** ../vim-8.2.1987/src/testdir/test_terminal.vim 2020-11-14 20:21:51.361723986 +0100 --- src/testdir/test_terminal.vim 2020-11-14 21:32:20.917734754 +0100 *************** *** 1237,1242 **** --- 1237,1260 ---- unlet s:winid endfunc + func Test_terminal_popup_insert_cmd() + CheckUnix + + inoremap call StartTermInPopup() + func StartTermInPopup() + call term_start(['/bin/sh', '-c', 'cat'], #{hidden: v:true})->popup_create(#{highlight: 'Pmenu'}) + endfunc + call feedkeys("i\") + sleep 10m + call assert_equal('n', mode()) + + call feedkeys("\", 'xt') + sleep 20m + call feedkeys(":q\", 'xt') + delfunc StartTermInPopup + iunmap + endfunc + func Check_dump01(off) call assert_equal('one two three four five', trim(getline(a:off + 1))) call assert_equal('~ Select Word', trim(getline(a:off + 7))) *** ../vim-8.2.1987/src/version.c 2020-11-14 21:04:29.213262892 +0100 --- src/version.c 2020-11-14 21:28:51.270183411 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1988, /**/ -- hundred-and-one symptoms of being an internet addict: 246. You use up your free 1 Gbyte in two days. /// 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 ///