Mercurial > vim
comparison src/testdir/test_cmdline.vim @ 30363:48c73657679c v9.0.0517
patch 9.0.0517: when at the command line :redrawstatus does not work well
Commit: https://github.com/vim/vim/commit/320d910064320f894a09ffdd1cd800ff5371e97f
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Sep 20 17:12:13 2022 +0100
patch 9.0.0517: when at the command line :redrawstatus does not work well
Problem: When at the command line :redrawstatus does not work well.
Solution: Only update the statuslines instead of the screen. (closes https://github.com/vim/vim/issues/11180)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 20 Sep 2022 18:15:03 +0200 |
parents | 7cd4655d7bf1 |
children | 57ebc2a4d2ca |
comparison
equal
deleted
inserted
replaced
30362:2922412560ad | 30363:48c73657679c |
---|---|
214 CheckScreendump | 214 CheckScreendump |
215 | 215 |
216 let lines =<< trim END | 216 let lines =<< trim END |
217 set laststatus=2 | 217 set laststatus=2 |
218 set statusline=%=:%{getcmdline()} | 218 set statusline=%=:%{getcmdline()} |
219 autocmd CmdlineChanged * if getcmdline() == 'foobar' | redrawstatus | endif | 219 autocmd CmdlineChanged * redrawstatus |
220 END | 220 END |
221 call writefile(lines, 'XTest_redrawstatus', 'D') | 221 call writefile(lines, 'XTest_redrawstatus', 'D') |
222 | 222 |
223 let buf = RunVimInTerminal('-S XTest_redrawstatus', {'rows': 8}) | 223 let buf = RunVimInTerminal('-S XTest_redrawstatus', {'rows': 8}) |
224 " :redrawstatus is postponed if messages have scrolled | 224 " :redrawstatus is postponed if messages have scrolled |
225 call term_sendkeys(buf, ":echo \"one\\ntwo\\nthree\\nfour\"\<CR>") | 225 call term_sendkeys(buf, ":echo \"one\\ntwo\\nthree\\nfour\"\<CR>") |
226 call term_sendkeys(buf, ":foobar") | 226 call term_sendkeys(buf, ":foobar") |
227 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_1', {}) | 227 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_1', {}) |
228 " it is not postponed if messages have not scrolled | 228 " it is not postponed if messages have not scrolled |
229 call term_sendkeys(buf, "\<Esc>:foobar") | 229 call term_sendkeys(buf, "\<Esc>:for in in range(3)") |
230 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_2', {}) | 230 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_2', {}) |
231 " with cmdheight=1 messages have scrolled when typing :endfor | |
232 call term_sendkeys(buf, "\<CR>:endfor") | |
233 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_3', {}) | |
234 call term_sendkeys(buf, "\<CR>:set cmdheight=2\<CR>") | |
235 " with cmdheight=2 messages haven't scrolled when typing :for or :endfor | |
236 call term_sendkeys(buf, ":for in in range(3)") | |
237 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_4', {}) | |
238 call term_sendkeys(buf, "\<CR>:endfor") | |
239 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_5', {}) | |
231 | 240 |
232 " clean up | 241 " clean up |
233 call term_sendkeys(buf, "\<CR>") | 242 call term_sendkeys(buf, "\<CR>") |
234 call StopVimInTerminal(buf) | 243 call StopVimInTerminal(buf) |
235 endfunc | 244 endfunc |