Mercurial > vim
comparison src/testdir/test_terminal.vim @ 22900:2c1520981e63 v8.2.1997
patch 8.2.1997: window changes when using bufload() while in a terminal popup
Commit: https://github.com/vim/vim/commit/8adc8d9b73121b647476a33d91d31d25e1c2d987
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 16 20:47:31 2020 +0100
patch 8.2.1997: window changes when using bufload() while in a terminal popup
Problem: Window changes when using bufload() while in a terminal popup.
Solution: When searching for a window by ID also find a popup window.
(closes #7307)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 16 Nov 2020 21:00:04 +0100 |
parents | be7f52838056 |
children | 1bde09eef44a |
comparison
equal
deleted
inserted
replaced
22899:66c1cf9b82e0 | 22900:2c1520981e63 |
---|---|
1233 call feedkeys("\<F3>", 'xt') | 1233 call feedkeys("\<F3>", 'xt') |
1234 | 1234 |
1235 tunmap <F3> | 1235 tunmap <F3> |
1236 exe 'bwipe! ' .. buf | 1236 exe 'bwipe! ' .. buf |
1237 unlet s:winid | 1237 unlet s:winid |
1238 endfunc | |
1239 | |
1240 func Test_terminal_popup_bufload() | |
1241 let termbuf = term_start(&shell, #{hidden: v:true, term_finish: 'close'}) | |
1242 let winid = popup_create(termbuf, {}) | |
1243 sleep 50m | |
1244 | |
1245 let newbuf = bufadd('') | |
1246 call bufload(newbuf) | |
1247 call setbufline(newbuf, 1, 'foobar') | |
1248 | |
1249 " must not have switched to another window | |
1250 call assert_equal(winid, win_getid()) | |
1251 | |
1252 call feedkeys("exit\<CR>", 'xt') | |
1253 sleep 50m | |
1254 exe 'bwipe! ' .. newbuf | |
1238 endfunc | 1255 endfunc |
1239 | 1256 |
1240 func Test_terminal_popup_insert_cmd() | 1257 func Test_terminal_popup_insert_cmd() |
1241 CheckUnix | 1258 CheckUnix |
1242 | 1259 |