Mercurial > vim
comparison src/testdir/test_terminal.vim @ 11912:22658e33203f v8.0.0836
patch 8.0.0836: can abandon a terminal buffer after making a change
commit https://github.com/vim/vim/commit/20e6cd07baed8992e7a509ccef7f111ffcded44d
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 1 20:25:22 2017 +0200
patch 8.0.0836: can abandon a terminal buffer after making a change
Problem: When a terminal buffer is changed it can still be accidentally
abandoned.
Solution: When making a change reset the 'buftype' option.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 01 Aug 2017 20:30:04 +0200 |
parents | 7df4afab67c7 |
children | 00836eb177cb |
comparison
equal
deleted
inserted
replaced
11911:85ff8fc2ab94 | 11912:22658e33203f |
---|---|
4 finish | 4 finish |
5 endif | 5 endif |
6 | 6 |
7 source shared.vim | 7 source shared.vim |
8 | 8 |
9 func Test_terminal_basic() | 9 func Run_shell_in_terminal() |
10 let buf = term_start(&shell) | 10 let buf = term_start(&shell) |
11 | 11 |
12 let termlist = term_list() | 12 let termlist = term_list() |
13 call assert_equal(1, len(termlist)) | 13 call assert_equal(1, len(termlist)) |
14 call assert_equal(buf, termlist[0]) | 14 call assert_equal(buf, termlist[0]) |
17 call assert_equal(v:t_job, type(g:job)) | 17 call assert_equal(v:t_job, type(g:job)) |
18 | 18 |
19 call term_sendkeys(buf, "exit\r") | 19 call term_sendkeys(buf, "exit\r") |
20 call WaitFor('job_status(g:job) == "dead"') | 20 call WaitFor('job_status(g:job) == "dead"') |
21 call assert_equal('dead', job_status(g:job)) | 21 call assert_equal('dead', job_status(g:job)) |
22 | |
23 return buf | |
24 endfunc | |
25 | |
26 func Test_terminal_basic() | |
27 let buf = Run_shell_in_terminal() | |
28 | |
29 exe buf . 'bwipe' | |
30 unlet g:job | |
31 endfunc | |
32 | |
33 func Test_terminal_make_change() | |
34 let buf = Run_shell_in_terminal() | |
35 call term_wait(buf) | |
36 | |
37 setlocal modifiable | |
38 exe "normal Axxx\<Esc>" | |
39 call assert_fails(buf . 'bwipe', 'E517') | |
40 undo | |
22 | 41 |
23 exe buf . 'bwipe' | 42 exe buf . 'bwipe' |
24 unlet g:job | 43 unlet g:job |
25 endfunc | 44 endfunc |
26 | 45 |