Mercurial > vim
comparison src/testdir/test_terminal.vim @ 20617:c81f61e3b508 v8.2.0862
patch 8.2.0862: ":term ++curwin" makes the current buffer hidden
Commit: https://github.com/vim/vim/commit/b10090928cb5283f867e8457b7eea0985470d8d4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 31 16:04:42 2020 +0200
patch 8.2.0862: ":term ++curwin" makes the current buffer hidden
Problem: ":term ++curwin" makes the current buffer hidden. (Harm te
Hennepe)
Solution: Do not hide the current buffer. (closes #6170)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 31 May 2020 16:15:03 +0200 |
parents | bed30e6b5a09 |
children | 1e2e81dbb958 |
comparison
equal
deleted
inserted
replaced
20616:3c58d3e60e98 | 20617:c81f61e3b508 |
---|---|
448 | 448 |
449 func Test_terminal_curwin() | 449 func Test_terminal_curwin() |
450 let cmd = Get_cat_123_cmd() | 450 let cmd = Get_cat_123_cmd() |
451 call assert_equal(1, winnr('$')) | 451 call assert_equal(1, winnr('$')) |
452 | 452 |
453 split dummy | 453 split Xdummy |
454 call setline(1, 'dummy') | |
455 write | |
456 call assert_equal(1, getbufinfo('Xdummy')[0].loaded) | |
454 exe 'terminal ++curwin ' . cmd | 457 exe 'terminal ++curwin ' . cmd |
455 call assert_equal(2, winnr('$')) | 458 call assert_equal(2, winnr('$')) |
459 call assert_equal(0, getbufinfo('Xdummy')[0].loaded) | |
456 bwipe! | 460 bwipe! |
457 | 461 |
458 split dummy | 462 split Xdummy |
459 call term_start(cmd, {'curwin': 1}) | 463 call term_start(cmd, {'curwin': 1}) |
460 call assert_equal(2, winnr('$')) | 464 call assert_equal(2, winnr('$')) |
461 bwipe! | 465 bwipe! |
462 | 466 |
463 split dummy | 467 split Xdummy |
464 call setline(1, 'change') | 468 call setline(1, 'change') |
465 call assert_fails('terminal ++curwin ' . cmd, 'E37:') | 469 call assert_fails('terminal ++curwin ' . cmd, 'E37:') |
466 call assert_equal(2, winnr('$')) | 470 call assert_equal(2, winnr('$')) |
467 exe 'terminal! ++curwin ' . cmd | 471 exe 'terminal! ++curwin ' . cmd |
468 call assert_equal(2, winnr('$')) | 472 call assert_equal(2, winnr('$')) |
469 bwipe! | 473 bwipe! |
470 | 474 |
471 split dummy | 475 split Xdummy |
472 call setline(1, 'change') | 476 call setline(1, 'change') |
473 call assert_fails("call term_start(cmd, {'curwin': 1})", 'E37:') | 477 call assert_fails("call term_start(cmd, {'curwin': 1})", 'E37:') |
474 call assert_equal(2, winnr('$')) | 478 call assert_equal(2, winnr('$')) |
475 bwipe! | 479 bwipe! |
476 | 480 |
477 split dummy | 481 split Xdummy |
478 bwipe! | 482 bwipe! |
479 call delete('Xtext') | 483 call delete('Xtext') |
484 call delete('Xdummy') | |
480 endfunc | 485 endfunc |
481 | 486 |
482 func s:get_sleep_cmd() | 487 func s:get_sleep_cmd() |
483 if s:python != '' | 488 if s:python != '' |
484 let cmd = s:python . " test_short_sleep.py" | 489 let cmd = s:python . " test_short_sleep.py" |