patch 9.0.0512: cannot redraw the status lines when editing a command

Problem:    Cannot redraw the status lines when editing a command.
Solution:   Only postpone the redraw when messages have scrolled.
            (closes #11170)
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 3014ac3..f81cec9 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -214,15 +214,20 @@
   CheckScreendump
 
   let lines =<< trim END
-      set cmdheight=2
+      set laststatus=2
+      set statusline=%=:%{getcmdline()}
       autocmd CmdlineChanged * if getcmdline() == 'foobar' | redrawstatus | endif
   END
   call writefile(lines, 'XTest_redrawstatus', 'D')
 
   let buf = RunVimInTerminal('-S XTest_redrawstatus', {'rows': 8})
+  " :redrawstatus is postponed if messages have scrolled
   call term_sendkeys(buf, ":echo \"one\\ntwo\\nthree\\nfour\"\<CR>")
   call term_sendkeys(buf, ":foobar")
   call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_1', {})
+  " it is not postponed if messages have not scrolled
+  call term_sendkeys(buf, "\<Esc>:foobar")
+  call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_2', {})
 
   " clean up
   call term_sendkeys(buf, "\<CR>")