Mercurial > vim
comparison src/testdir/screendump.vim @ 13541:296d02b0637f v8.0.1644
patch 8.0.1644: terminal API tests still fail
commit https://github.com/vim/vim/commit/cf67a509e93167f14c892301e13de14636cedc61
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 25 20:31:32 2018 +0200
patch 8.0.1644: terminal API tests still fail
Problem: Terminal API tests still fail.
Solution: Explicitly set 'title' in the terminal job. (Ozaki Kiichi,
closes #2750)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 25 Mar 2018 20:45:06 +0200 |
parents | 3fa880445c99 |
children | af68603e213d |
comparison
equal
deleted
inserted
replaced
13540:8615a18244bb | 13541:296d02b0637f |
---|---|
22 | 22 |
23 " Run Vim with "arguments" in a new terminal window. | 23 " Run Vim with "arguments" in a new terminal window. |
24 " By default uses a size of 20 lines and 75 columns. | 24 " By default uses a size of 20 lines and 75 columns. |
25 " Returns the buffer number of the terminal. | 25 " Returns the buffer number of the terminal. |
26 " | 26 " |
27 " Options is a dictionary (not used yet). | 27 " Options is a dictionary, these items are recognized: |
28 " "rows" - height of the terminal window (max. 20) | |
29 " "cols" - width of the terminal window (max. 78) | |
28 func RunVimInTerminal(arguments, options) | 30 func RunVimInTerminal(arguments, options) |
29 " If Vim doesn't exit a swap file remains, causing other tests to fail. | 31 " If Vim doesn't exit a swap file remains, causing other tests to fail. |
30 " Remove it here. | 32 " Remove it here. |
31 call delete(".swp") | 33 call delete(".swp") |
32 | 34 |
45 | 47 |
46 " Always do this with 256 colors and a light background. | 48 " Always do this with 256 colors and a light background. |
47 set t_Co=256 background=light | 49 set t_Co=256 background=light |
48 hi Normal ctermfg=NONE ctermbg=NONE | 50 hi Normal ctermfg=NONE ctermbg=NONE |
49 | 51 |
50 " Make the window 20 lines high, unless told otherwise. | 52 " Make the window 20 lines high and 75 columns, unless told otherwise. |
51 let rows = 20 | 53 let rows = get(a:options, 'rows', 20) |
52 if has_key(a:options, 'rows') | 54 let cols = get(a:options, 'cols', 75) |
53 let rows = a:options['rows'] | |
54 endif | |
55 | 55 |
56 let cmd = GetVimCommandClean() | 56 let cmd = GetVimCommandClean() |
57 " Add -v to have gvim run in the terminal (if possible) | 57 " Add -v to have gvim run in the terminal (if possible) |
58 let cmd .= ' -v ' . a:arguments | 58 let cmd .= ' -v ' . a:arguments |
59 let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': 75}) | 59 let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': cols}) |
60 call assert_equal([rows, 75], term_getsize(buf)) | 60 call assert_equal([rows, cols], term_getsize(buf)) |
61 | 61 |
62 return buf | 62 return buf |
63 endfunc | 63 endfunc |
64 | 64 |
65 " Stop a Vim running in terminal buffer "buf". | 65 " Stop a Vim running in terminal buffer "buf". |