Mercurial > vim
comparison src/testdir/test_autocmd.vim @ 18227:7d90fa3e5f8d v8.1.2108
patch 8.1.2108: cannot close the cmdline window from CmdWinEnter
Commit: https://github.com/vim/vim/commit/23324a0b35d18c5caac20b1d543ed2d1f762f5b5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 1 17:39:04 2019 +0200
patch 8.1.2108: cannot close the cmdline window from CmdWinEnter
Problem: Cannot close the cmdline window from CmdWinEnter. (George Brown)
Solution: Reset cmdwin_result earlier. (Christian Brabandt, closes https://github.com/vim/vim/issues/4980)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 01 Oct 2019 17:45:04 +0200 |
parents | f7d9f8fe70be |
children | 0cb608fc9c60 |
comparison
equal
deleted
inserted
replaced
18226:78e84b457783 | 18227:7d90fa3e5f8d |
---|---|
2257 call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000) | 2257 call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000) |
2258 | 2258 |
2259 call StopVimInTerminal(buf) | 2259 call StopVimInTerminal(buf) |
2260 call delete('XSafeState') | 2260 call delete('XSafeState') |
2261 endfunc | 2261 endfunc |
2262 | |
2263 func Test_autocmd_CmdWinEnter() | |
2264 CheckRunVimInTerminal | |
2265 " There is not cmdwin switch, so | |
2266 " test for cmdline_hist | |
2267 " (both are available with small builds) | |
2268 CheckFeature cmdline_hist | |
2269 let lines =<< trim END | |
2270 let b:dummy_var = 'This is a dummy' | |
2271 autocmd CmdWinEnter * quit | |
2272 let winnr = winnr('$') | |
2273 END | |
2274 let filename='XCmdWinEnter' | |
2275 call writefile(lines, filename) | |
2276 let buf = RunVimInTerminal('-S '.filename, #{rows: 6}) | |
2277 | |
2278 call term_sendkeys(buf, "q:") | |
2279 call term_wait(buf) | |
2280 call term_sendkeys(buf, ":echo b:dummy_var\<cr>") | |
2281 call WaitForAssert({-> assert_match('^This is a dummy', term_getline(buf, 6))}, 1000) | |
2282 call term_sendkeys(buf, ":echo &buftype\<cr>") | |
2283 call WaitForAssert({-> assert_notmatch('^nofile', term_getline(buf, 6))}, 1000) | |
2284 call term_sendkeys(buf, ":echo winnr\<cr>") | |
2285 call WaitForAssert({-> assert_match('^1', term_getline(buf, 6))}, 1000) | |
2286 | |
2287 " clean up | |
2288 call StopVimInTerminal(buf) | |
2289 call delete(filename) | |
2290 endfunc |