Mercurial > vim
comparison src/testdir/test_terminal.vim @ 13742:a34b1323286c v8.0.1743
patch 8.0.1743: terminal window options are named inconsistently
commit https://github.com/vim/vim/commit/6d150f783d5d3820fe69734dda1e79b8276a84d2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 21 20:03:20 2018 +0200
patch 8.0.1743: terminal window options are named inconsistently
Problem: Terminal window options are named inconsistently.
Solution: prefix terminal window options with "termwin". Keep the old names
for now as an alias.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 21 Apr 2018 20:15:07 +0200 |
parents | 7d2039b2ecc8 |
children | 3ab6198c1f9a |
comparison
equal
deleted
inserted
replaced
13741:ef2ae120f25c | 13742:a34b1323286c |
---|---|
271 call delete('Xtext') | 271 call delete('Xtext') |
272 endfunc | 272 endfunc |
273 | 273 |
274 func Test_terminal_scrollback() | 274 func Test_terminal_scrollback() |
275 let buf = Run_shell_in_terminal({}) | 275 let buf = Run_shell_in_terminal({}) |
276 set terminalscroll=100 | 276 set termwinscroll=100 |
277 call writefile(range(150), 'Xtext') | 277 call writefile(range(150), 'Xtext') |
278 if has('win32') | 278 if has('win32') |
279 call term_sendkeys(buf, "type Xtext\<CR>") | 279 call term_sendkeys(buf, "type Xtext\<CR>") |
280 else | 280 else |
281 call term_sendkeys(buf, "cat Xtext\<CR>") | 281 call term_sendkeys(buf, "cat Xtext\<CR>") |
287 call assert_inrange(91, 100, lines) | 287 call assert_inrange(91, 100, lines) |
288 | 288 |
289 call Stop_shell_in_terminal(buf) | 289 call Stop_shell_in_terminal(buf) |
290 call term_wait(buf) | 290 call term_wait(buf) |
291 exe buf . 'bwipe' | 291 exe buf . 'bwipe' |
292 set terminalscroll& | 292 set termwinscroll& |
293 endfunc | 293 endfunc |
294 | 294 |
295 func Test_terminal_size() | 295 func Test_terminal_size() |
296 let cmd = Get_cat_123_cmd() | 296 let cmd = Get_cat_123_cmd() |
297 | 297 |
1379 call Stop_shell_in_terminal(buf) | 1379 call Stop_shell_in_terminal(buf) |
1380 call term_wait(buf) | 1380 call term_wait(buf) |
1381 exe buf . 'bwipe' | 1381 exe buf . 'bwipe' |
1382 endfunc | 1382 endfunc |
1383 | 1383 |
1384 func Test_terminal_termsize_option_fixed() | 1384 func Test_terminal_termwinsize_option_fixed() |
1385 if !CanRunVimInTerminal() | 1385 if !CanRunVimInTerminal() |
1386 return | 1386 return |
1387 endif | 1387 endif |
1388 set termsize=6x40 | 1388 set termwinsize=6x40 |
1389 let text = [] | 1389 let text = [] |
1390 for n in range(10) | 1390 for n in range(10) |
1391 call add(text, repeat(n, 50)) | 1391 call add(text, repeat(n, 50)) |
1392 endfor | 1392 endfor |
1393 call writefile(text, 'Xwinsize') | 1393 call writefile(text, 'Xwinsize') |
1405 call assert_equal(60, winwidth(win)) | 1405 call assert_equal(60, winwidth(win)) |
1406 | 1406 |
1407 call StopVimInTerminal(buf) | 1407 call StopVimInTerminal(buf) |
1408 call delete('Xwinsize') | 1408 call delete('Xwinsize') |
1409 | 1409 |
1410 call assert_fails('set termsize=40', 'E474') | 1410 call assert_fails('set termwinsize=40', 'E474') |
1411 call assert_fails('set termsize=10+40', 'E474') | 1411 call assert_fails('set termwinsize=10+40', 'E474') |
1412 call assert_fails('set termsize=abc', 'E474') | 1412 call assert_fails('set termwinsize=abc', 'E474') |
1413 | 1413 |
1414 set termsize= | 1414 set termwinsize= |
1415 endfunc | 1415 endfunc |
1416 | 1416 |
1417 func Test_terminal_termsize_option_zero() | 1417 func Test_terminal_termwinsize_option_zero() |
1418 set termsize=0x0 | 1418 set termwinsize=0x0 |
1419 let buf = Run_shell_in_terminal({}) | 1419 let buf = Run_shell_in_terminal({}) |
1420 let win = bufwinid(buf) | 1420 let win = bufwinid(buf) |
1421 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf)) | 1421 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf)) |
1422 call Stop_shell_in_terminal(buf) | 1422 call Stop_shell_in_terminal(buf) |
1423 call term_wait(buf) | 1423 call term_wait(buf) |
1424 exe buf . 'bwipe' | 1424 exe buf . 'bwipe' |
1425 | 1425 |
1426 set termsize=7x0 | 1426 set termwinsize=7x0 |
1427 let buf = Run_shell_in_terminal({}) | 1427 let buf = Run_shell_in_terminal({}) |
1428 let win = bufwinid(buf) | 1428 let win = bufwinid(buf) |
1429 call assert_equal([7, winwidth(win)], term_getsize(buf)) | 1429 call assert_equal([7, winwidth(win)], term_getsize(buf)) |
1430 call Stop_shell_in_terminal(buf) | 1430 call Stop_shell_in_terminal(buf) |
1431 call term_wait(buf) | 1431 call term_wait(buf) |
1432 exe buf . 'bwipe' | 1432 exe buf . 'bwipe' |
1433 | 1433 |
1434 set termsize=0x33 | 1434 set termwinsize=0x33 |
1435 let buf = Run_shell_in_terminal({}) | 1435 let buf = Run_shell_in_terminal({}) |
1436 let win = bufwinid(buf) | 1436 let win = bufwinid(buf) |
1437 call assert_equal([winheight(win), 33], term_getsize(buf)) | 1437 call assert_equal([winheight(win), 33], term_getsize(buf)) |
1438 call Stop_shell_in_terminal(buf) | 1438 call Stop_shell_in_terminal(buf) |
1439 call term_wait(buf) | 1439 call term_wait(buf) |
1440 exe buf . 'bwipe' | 1440 exe buf . 'bwipe' |
1441 | 1441 |
1442 set termsize= | 1442 set termwinsize= |
1443 endfunc | 1443 endfunc |
1444 | 1444 |
1445 func Test_terminal_termsize_mininmum() | 1445 func Test_terminal_termwinsize_mininmum() |
1446 set termsize=10*50 | 1446 set termwinsize=10*50 |
1447 vsplit | 1447 vsplit |
1448 let buf = Run_shell_in_terminal({}) | 1448 let buf = Run_shell_in_terminal({}) |
1449 let win = bufwinid(buf) | 1449 let win = bufwinid(buf) |
1450 call assert_inrange(10, 1000, winheight(win)) | 1450 call assert_inrange(10, 1000, winheight(win)) |
1451 call assert_inrange(50, 1000, winwidth(win)) | 1451 call assert_inrange(50, 1000, winwidth(win)) |
1467 | 1467 |
1468 call Stop_shell_in_terminal(buf) | 1468 call Stop_shell_in_terminal(buf) |
1469 call term_wait(buf) | 1469 call term_wait(buf) |
1470 exe buf . 'bwipe' | 1470 exe buf . 'bwipe' |
1471 | 1471 |
1472 set termsize=0*0 | 1472 set termwinsize=0*0 |
1473 let buf = Run_shell_in_terminal({}) | 1473 let buf = Run_shell_in_terminal({}) |
1474 let win = bufwinid(buf) | 1474 let win = bufwinid(buf) |
1475 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf)) | 1475 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf)) |
1476 call Stop_shell_in_terminal(buf) | 1476 call Stop_shell_in_terminal(buf) |
1477 call term_wait(buf) | 1477 call term_wait(buf) |
1478 exe buf . 'bwipe' | 1478 exe buf . 'bwipe' |
1479 | 1479 |
1480 set termsize= | 1480 set termwinsize= |
1481 endfunc | 1481 endfunc |