diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-22 21:39:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-22 21:39:30 +0200 |
commit | 9f28416e54cefe8b6a2382d078c78f1d469e60cd (patch) | |
tree | 88c52a1ac67d90fd348ebba0c237f1dcc7c2dbf5 /src | |
parent | 11e3c5ba820325b69cb56f70e13c21d7b8808d33 (diff) |
patch 8.2.2800: after a timer displays text a hit-enter prompt is givenv8.2.2800
Problem: After a timer displays text a hit-enter prompt is given.
Solution: Reset msg_didany and need_wait_return. (closes #8136)
Diffstat (limited to 'src')
-rw-r--r-- | src/drawscreen.c | 7 | ||||
-rw-r--r-- | src/testdir/test_timers.vim | 22 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c index 7df4a96f0e..4a716b29de 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -3002,6 +3002,13 @@ redraw_after_callback(int call_update_screen) // keep the command line if possible update_screen(VALID_NO_UPDATE); setcursor(); + + if (msg_scrolled == 0) + { + // don't want a hit-enter prompt when something else is displayed + msg_didany = FALSE; + need_wait_return = FALSE; + } } cursor_on(); #ifdef FEAT_GUI diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim index 47e2699f13..caeeed6e53 100644 --- a/src/testdir/test_timers.vim +++ b/src/testdir/test_timers.vim @@ -449,4 +449,26 @@ func Test_timer_changing_function_list() call delete('XTest_timerchange') endfunc +func Test_timer_outputting_message() + CheckRunVimInTerminal + + let lines =<< trim END + vim9script + setline(1, 'some text') + set showcmd ut=2000 cmdheight=1 + timer_start(0, (_) => { + echon repeat('x', &columns - 11) + }) + END + call writefile(lines, 'XTest_timermessage') + let buf = RunVimInTerminal('-S XTest_timermessage', #{rows: 6}) + call term_sendkeys(buf, "l") + call term_wait(buf) + " should not get a hit-enter prompt + call WaitForAssert({-> assert_match('xxxxxxxxxxx', term_getline(buf, 6))}) + + call StopVimInTerminal(buf) + call delete('XTest_timermessage') +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 1c33c9f348..ebe5268797 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2800, +/**/ 2799, /**/ 2798, |