Patch 8.2.1762

6 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 27, 2020, 2:13:51 PM9/27/20
to vim...@googlegroups.com

Patch 8.2.1762
Problem: When a timer uses :stopinsert Insert mode completion isn't
stopped. (Stanley Chan)
Solution: Call ins_compl_prep(ESC).
Files: src/edit.c, src/testdir/test_ins_complete.vim,
src/testdir/dumps/Test_pum_stopped_by_timer.dump


*** ../vim-8.2.1761/src/edit.c 2020-09-08 22:45:31.113504961 +0200
--- src/edit.c 2020-09-27 20:11:31.637561050 +0200
***************
*** 587,594 ****
--- 587,597 ----
if (stop_insert_mode)
{
// Insert mode ended, possibly from a callback.
+ if (c != K_IGNORE && c != K_NOP)
+ vungetc(c);
count = 0;
nomove = TRUE;
+ ins_compl_prep(ESC);
goto doESCkey;
}
} while (c == K_IGNORE || c == K_NOP);
*** ../vim-8.2.1761/src/testdir/test_ins_complete.vim 2020-09-26 18:47:03.401502472 +0200
--- src/testdir/test_ins_complete.vim 2020-09-27 20:07:43.230250094 +0200
***************
*** 407,412 ****
--- 407,434 ----
set completeslash=
endfunc

+ func Test_pum_stopped_by_timer()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, ['hello', 'hullo', 'heeee', ''])
+ func StartCompl()
+ call timer_start(100, { -> execute('stopinsert') })
+ call feedkeys("Gah\<C-N>")
+ endfunc
+ END
+
+ call writefile(lines, 'Xpumscript')
+ let buf = RunVimInTerminal('-S Xpumscript', #{rows: 12})
+ call term_sendkeys(buf, ":call StartCompl()\<CR>")
+ call TermWait(buf, 200)
+ call term_sendkeys(buf, "k")
+ call VerifyScreenDump(buf, 'Test_pum_stopped_by_timer', {})
+
+ call StopVimInTerminal(buf)
+ call delete('Xpumscript')
+ endfunc
+
func Test_pum_with_folds_two_tabs()
CheckScreendump

*** ../vim-8.2.1761/src/testdir/dumps/Test_pum_stopped_by_timer.dump 2020-09-27 20:12:40.705357374 +0200
--- src/testdir/dumps/Test_pum_stopped_by_timer.dump 2020-09-27 20:11:45.429520235 +0200
***************
*** 0 ****
--- 1,12 ----
+ |h+0&#ffffff0|e|l@1|o| @69
+ |h|u|l@1|o| @69
+ |h|e@2>e| @69
+ |h|e|l@1|o| @69
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ | +0#0000000&@56|3|,|5| @10|A|l@1|
*** ../vim-8.2.1761/src/version.c 2020-09-27 19:05:28.944098100 +0200
--- src/version.c 2020-09-27 20:12:29.949388982 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1762,
/**/

--
hundred-and-one symptoms of being an internet addict:
4. Your eyeglasses have a web site burned in on them.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages