Mercurial > vim
comparison src/testdir/test_terminal.vim @ 13444:9f06f7aca74c v8.0.1596
patch 8.0.1596: no autocommand specifically for opening a terminal window
commit https://github.com/vim/vim/commit/b852c3e64d319d6ec47dd780c8654ae095e1d8c2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 11 16:55:36 2018 +0100
patch 8.0.1596: no autocommand specifically for opening a terminal window
Problem: No autocommand specifically for opening a terminal window.
Solution: Add TerminalOpen. (?, closes https://github.com/vim/vim/issues/2484)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 11 Mar 2018 17:00:08 +0100 |
parents | 22439cdda382 |
children | 568dcfac9daf |
comparison
equal
deleted
inserted
replaced
13443:b8e5a0ebfcbd | 13444:9f06f7aca74c |
---|---|
906 call WaitFor({-> term_getstatus(buf) == "finished"}) | 906 call WaitFor({-> term_getstatus(buf) == "finished"}) |
907 | 907 |
908 " close the terminal window where Vim was running | 908 " close the terminal window where Vim was running |
909 quit | 909 quit |
910 endfunc | 910 endfunc |
911 | |
912 func Test_terminalopen_autocmd() | |
913 augroup repro | |
914 au! | |
915 au TerminalOpen * let s:called += 1 | |
916 augroup END | |
917 | |
918 let s:called = 0 | |
919 | |
920 " Open a terminal window with :terminal | |
921 terminal | |
922 call assert_equal(1, s:called) | |
923 bwipe! | |
924 | |
925 " Open a terminal window with term_start() | |
926 call term_start(&shell) | |
927 call assert_equal(2, s:called) | |
928 bwipe! | |
929 | |
930 " Open a hidden terminal buffer with :terminal | |
931 terminal ++hidden | |
932 call assert_equal(3, s:called) | |
933 for buf in term_list() | |
934 exe buf . "bwipe!" | |
935 endfor | |
936 | |
937 " Open a hidden terminal buffer with term_start() | |
938 let buf = term_start(&shell, {'hidden': 1}) | |
939 call assert_equal(4, s:called) | |
940 exe buf . "bwipe!" | |
941 | |
942 unlet s:called | |
943 au! repro | |
944 endfunction |