]> granicus.if.org Git - vim/commitdiff
patch 8.2.2800: after a timer displays text a hit-enter prompt is given v8.2.2800
authorBram Moolenaar <Bram@vim.org>
Thu, 22 Apr 2021 19:39:30 +0000 (21:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 22 Apr 2021 19:39:30 +0000 (21:39 +0200)
Problem:    After a timer displays text a hit-enter prompt is given.
Solution:   Reset msg_didany and need_wait_return. (closes #8136)

src/drawscreen.c
src/testdir/test_timers.vim
src/version.c

index 7df4a96f0e593e5f9d8b6654ace114ad5c6cea0c..4a716b29de1f8515d49e77b299ef5c0404b707f4 100644 (file)
@@ -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
index 47e2699f13fc7f921f316d5acbd2917cce6b8ec5..caeeed6e53242398eb9cfc8135d92866dbcacea1 100644 (file)
@@ -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
index 1c33c9f34887593818566b9aca9dc1fd3ea289de..ebe5268797aaf0fb359688f23bfa9423b506405e 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2800,
 /**/
     2799,
 /**/