Skip to content

Commit

Permalink
patch 8.2.2800: after a timer displays text a hit-enter prompt is given
Browse files Browse the repository at this point in the history
Problem:    After a timer displays text a hit-enter prompt is given.
Solution:   Reset msg_didany and need_wait_return. (closes #8136)
  • Loading branch information
brammool committed Apr 22, 2021
1 parent 11e3c5b commit 9f28416
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/drawscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions src/testdir/test_timers.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2800,
/**/
2799,
/**/
Expand Down

0 comments on commit 9f28416

Please sign in to comment.