Mercurial > vim
comparison src/testdir/test_cmdline.vim @ 27712:9c96612730a0 v8.2.4382
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Commit: https://github.com/vim/vim/commit/e4835bf34001471a102528659af009bc46361141
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 14 19:17:53 2022 +0000
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Problem: A custom 'tabline' may cause Esc to work like Enter on the
command line when the popup menu is displayed.
Solution: Save and restore KeyTyped. (closes #9776)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 14 Feb 2022 20:30:02 +0100 |
parents | 3f57b0a8cd29 |
children | 637ccebaf328 |
comparison
equal
deleted
inserted
replaced
27711:6fdafb9cb90e | 27712:9c96612730a0 |
---|---|
2105 endfunc | 2105 endfunc |
2106 func SetupStatusline() | 2106 func SetupStatusline() |
2107 set statusline=%!MyStatusLine() | 2107 set statusline=%!MyStatusLine() |
2108 set laststatus=2 | 2108 set laststatus=2 |
2109 endfunc | 2109 endfunc |
2110 | |
2111 func MyTabLine() | |
2112 return 'my tab line' | |
2113 endfunc | |
2114 func SetupTabline() | |
2115 set statusline= | |
2116 set tabline=%!MyTabLine() | |
2117 set showtabline=2 | |
2118 endfunc | |
2110 [CODE] | 2119 [CODE] |
2111 call writefile(commands, 'Xtest') | 2120 call writefile(commands, 'Xtest') |
2112 | 2121 |
2113 let buf = RunVimInTerminal('-S Xtest', #{rows: 10}) | 2122 let buf = RunVimInTerminal('-S Xtest', #{rows: 10}) |
2114 | 2123 |
2295 " Esc still works to abort the command when 'statusline' is set | 2304 " Esc still works to abort the command when 'statusline' is set |
2296 call term_sendkeys(buf, ":call SetupStatusline()\<CR>") | 2305 call term_sendkeys(buf, ":call SetupStatusline()\<CR>") |
2297 call term_sendkeys(buf, ":si\<Tab>") | 2306 call term_sendkeys(buf, ":si\<Tab>") |
2298 call term_sendkeys(buf, "\<Esc>") | 2307 call term_sendkeys(buf, "\<Esc>") |
2299 call VerifyScreenDump(buf, 'Test_wildmenu_pum_39', {}) | 2308 call VerifyScreenDump(buf, 'Test_wildmenu_pum_39', {}) |
2309 | |
2310 " Esc still works to abort the command when 'tabline' is set | |
2311 call term_sendkeys(buf, ":call SetupTabline()\<CR>") | |
2312 call term_sendkeys(buf, ":si\<Tab>") | |
2313 call term_sendkeys(buf, "\<Esc>") | |
2314 call VerifyScreenDump(buf, 'Test_wildmenu_pum_40', {}) | |
2300 | 2315 |
2301 call term_sendkeys(buf, "\<C-U>\<CR>") | 2316 call term_sendkeys(buf, "\<C-U>\<CR>") |
2302 call StopVimInTerminal(buf) | 2317 call StopVimInTerminal(buf) |
2303 call delete('Xtest') | 2318 call delete('Xtest') |
2304 call delete('Xdir', 'rf') | 2319 call delete('Xdir', 'rf') |