Mercurial > vim
comparison src/testdir/test_terminal3.vim @ 28580:39df510f97c3 v8.2.4814
patch 8.2.4814: possible to leave a popup window with win_gotoid()
Commit: https://github.com/vim/vim/commit/4a392d244018fadda375a490f4f4b921023248b9
Author: LemonBoy <thatlemon@gmail.com>
Date: Sat Apr 23 14:07:56 2022 +0100
patch 8.2.4814: possible to leave a popup window with win_gotoid()
Problem: Possible to leave a popup window with win_gotoid().
Solution: Give an error when trying to leave a popup window with
win_gotoid(). (closes #10253)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 23 Apr 2022 15:15:03 +0200 |
parents | 2961745336b8 |
children | c8ebe35b2475 |
comparison
equal
deleted
inserted
replaced
28579:15fd1bae2d57 | 28580:39df510f97c3 |
---|---|
526 call popup_close(win1) | 526 call popup_close(win1) |
527 exe buf1 .. 'bwipe!' | 527 exe buf1 .. 'bwipe!' |
528 exe buf2 .. 'bwipe!' | 528 exe buf2 .. 'bwipe!' |
529 endfunc | 529 endfunc |
530 | 530 |
531 func Test_escape_popup_terminal() | |
532 set hidden | |
533 | |
534 " Cannot escape a terminal popup window using win_gotoid | |
535 let prev_win = win_getid() | |
536 eval term_start('sh', #{hidden: 1, term_finish: 'close'})->popup_create({}) | |
537 call assert_fails("call win_gotoid(" .. prev_win .. ")", 'E863:') | |
538 | |
539 call popup_clear(1) | |
540 set hidden& | |
541 endfunc | |
542 | |
531 func Test_issue_5607() | 543 func Test_issue_5607() |
532 let wincount = winnr('$') | 544 let wincount = winnr('$') |
533 exe 'terminal' &shell &shellcmdflag 'exit' | 545 exe 'terminal' &shell &shellcmdflag 'exit' |
534 let job = term_getjob(bufnr()) | 546 let job = term_getjob(bufnr()) |
535 call WaitForAssert({-> assert_equal("dead", job_status(job))}) | 547 call WaitForAssert({-> assert_equal("dead", job_status(job))}) |