Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 22367:997bbc35c181 v8.2.1732
patch 8.2.1732: stuck when win_execute() for a popup causes an error
Commit: https://github.com/vim/vim/commit/6bf1b52ba2816dffdbd0d994320abfb1586bf666
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 23 17:41:26 2020 +0200
patch 8.2.1732: stuck when win_execute() for a popup causes an error
Problem: Stuck when win_execute() for a popup causes an error.
Solution: Disable the filter callback on error. (issue https://github.com/vim/vim/issues/6999)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Sep 2020 17:45:03 +0200 |
parents | 00f2eebe74d9 |
children | b2cb2a321af9 |
comparison
equal
deleted
inserted
replaced
22366:5dd250163338 | 22367:997bbc35c181 |
---|---|
1552 call TermWait(buf, 100) | 1552 call TermWait(buf, 100) |
1553 call VerifyScreenDump(buf, 'Test_popupwin_normal_cmd', {}) | 1553 call VerifyScreenDump(buf, 'Test_popupwin_normal_cmd', {}) |
1554 | 1554 |
1555 call StopVimInTerminal(buf) | 1555 call StopVimInTerminal(buf) |
1556 call delete('XtestPopupNormal') | 1556 call delete('XtestPopupNormal') |
1557 endfunc | |
1558 | |
1559 " this tests that we don't get stuck with an error in "win_execute()" | |
1560 func Test_popup_filter_win_execute() | |
1561 CheckScreendump | |
1562 | |
1563 let lines =<< trim END | |
1564 let g:winid = popup_create('some text', {'filter': 'invalidfilter'}) | |
1565 call timer_start(0, {-> win_execute(g:winid, 'invalidCommand')}) | |
1566 END | |
1567 call writefile(lines, 'XtestPopupWinExecute') | |
1568 let buf = RunVimInTerminal('-S XtestPopupWinExecute', #{rows: 10, wait_for_ruler: 0}) | |
1569 | |
1570 call WaitFor({-> term_getline(buf, 9) =~ 'Not an editor command: invalidCommand'}) | |
1571 call term_sendkeys(buf, "\<CR>") | |
1572 call WaitFor({-> term_getline(buf, 9) =~ 'Unknown function: invalidfilter'}) | |
1573 call term_sendkeys(buf, "\<CR>") | |
1574 call WaitFor({-> term_getline(buf, 9) =~ 'Not allowed in a popup window'}) | |
1575 call term_sendkeys(buf, "\<CR>") | |
1576 call term_sendkeys(buf, "\<CR>") | |
1577 call VerifyScreenDump(buf, 'Test_popupwin_win_execute', {}) | |
1578 | |
1579 call StopVimInTerminal(buf) | |
1580 call delete('XtestPopupWinExecute') | |
1557 endfunc | 1581 endfunc |
1558 | 1582 |
1559 func ShowDialog(key, result) | 1583 func ShowDialog(key, result) |
1560 let s:cb_res = 999 | 1584 let s:cb_res = 999 |
1561 let winid = popup_dialog('do you want to quit (Yes/no)?', #{ | 1585 let winid = popup_dialog('do you want to quit (Yes/no)?', #{ |