Mercurial > vim
comparison src/testdir/test_terminal.vim @ 19647:c8cb1a41f64c v8.2.0380
patch 8.2.0380: tiny popup when creating a terminal popup without minwidth
Commit: https://github.com/vim/vim/commit/193982650960f8411df51f3b3b0d44a75e1ac034
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 14 15:28:08 2020 +0100
patch 8.2.0380: tiny popup when creating a terminal popup without minwidth
Problem: Tiny popup when creating a terminal popup without minwidth.
Solution: Use a default mininum size of 5 lines of 20 characters.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 14 Mar 2020 15:30:03 +0100 |
parents | 4cce471fa537 |
children | 283c8bc6a8e2 |
comparison
equal
deleted
inserted
replaced
19646:847a300aa244 | 19647:c8cb1a41f64c |
---|---|
2398 call term_wait(buf, 100) | 2398 call term_wait(buf, 100) |
2399 call term_sendkeys(buf, ":q\<CR>") | 2399 call term_sendkeys(buf, ":q\<CR>") |
2400 call term_wait(buf, 100) " wait for terminal to vanish | 2400 call term_wait(buf, 100) " wait for terminal to vanish |
2401 | 2401 |
2402 call StopVimInTerminal(buf) | 2402 call StopVimInTerminal(buf) |
2403 call delete('Xtext') | |
2404 call delete('XtermPopup') | |
2405 endfunc | |
2406 | |
2407 " Check a terminal in popup window uses the default mininum size. | |
2408 func Test_terminal_in_popup_min_size() | |
2409 CheckRunVimInTerminal | |
2410 | |
2411 let text =<< trim END | |
2412 another text | |
2413 to show | |
2414 in a popup window | |
2415 END | |
2416 call writefile(text, 'Xtext') | |
2417 let lines = [ | |
2418 \ 'set t_u7=', | |
2419 \ 'call setline(1, range(20))', | |
2420 \ 'hi PopTerm ctermbg=grey', | |
2421 \ 'func OpenTerm()', | |
2422 \ " let s:buf = term_start('cat Xtext', #{hidden: 1})", | |
2423 \ ' let g:winid = popup_create(s:buf, #{ border: []})', | |
2424 \ 'endfunc', | |
2425 \ ] | |
2426 call writefile(lines, 'XtermPopup') | |
2427 let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15}) | |
2428 call term_wait(buf, 100) | |
2429 call term_sendkeys(buf, "\<C-L>") | |
2430 call term_sendkeys(buf, ":call OpenTerm()\<CR>") | |
2431 call term_wait(buf, 100) | |
2432 call term_sendkeys(buf, ":\<CR>") | |
2433 call VerifyScreenDump(buf, 'Test_terminal_popup_m1', {}) | |
2434 | |
2435 call term_wait(buf, 100) | |
2436 call term_sendkeys(buf, ":q\<CR>") | |
2437 call term_wait(buf, 100) " wait for terminal to vanish | |
2438 call StopVimInTerminal(buf) | |
2439 call delete('Xtext') | |
2403 call delete('XtermPopup') | 2440 call delete('XtermPopup') |
2404 endfunc | 2441 endfunc |
2405 | 2442 |
2406 func Test_double_popup_terminal() | 2443 func Test_double_popup_terminal() |
2407 let buf1 = term_start(&shell, #{hidden: 1}) | 2444 let buf1 = term_start(&shell, #{hidden: 1}) |