1
0
forked from aniani/vim

patch 8.0.0716: not easy to start Vim cleanly

Problem:    Not easy to start Vim cleanly without changing the viminfo file.
            Not possible to know whether the -i command line flag was used.
Solution:   Add the --clean command line argument.  Add the 'viminfofile'
            option.  Add "-u DEFAULTS".
This commit is contained in:
Bram Moolenaar
2017-07-15 19:39:43 +02:00
parent a92522fbf3
commit c4da113ef9
13 changed files with 154 additions and 44 deletions

View File

@@ -739,6 +739,38 @@ func Test_pipe_to_buffer_name_nomsg()
call Run_test_pipe_to_buffer(1, 0, 1)
endfunc
func Test_close_output_buffer()
if !has('job')
return
endif
enew!
let test_lines = ['one', 'two']
call setline(1, test_lines)
call ch_log('Test_close_output_buffer()')
let options = {'out_io': 'buffer'}
let options['out_name'] = 'buffer-output'
let options['out_msg'] = 0
split buffer-output
let job = job_start(s:python . " test_channel_write.py", options)
call assert_equal("run", job_status(job))
try
call WaitFor('line("$") == 3')
call assert_equal(3, line('$'))
quit!
sleep 100m
" Make sure the write didn't happen to the wrong buffer.
call assert_equal(test_lines, getline(1, line('$')))
call assert_equal(-1, bufwinnr('buffer-output'))
sbuf buffer-output
call assert_notequal(-1, bufwinnr('buffer-output'))
sleep 100m
close " no more writes
bwipe!
finally
call job_stop(job)
endtry
endfunc
func Run_test_pipe_err_to_buffer(use_name, nomod, do_msg)
if !has('job')
return

View File

@@ -0,0 +1,18 @@
#!/usr/bin/python
#
# Program that writes a number to stdout repeatedly
#
# This requires Python 2.6 or later.
from __future__ import print_function
import sys
import time
if __name__ == "__main__":
done = 0
while done < 10:
done = done + 1
print(done)
sys.stdout.flush()
time.sleep(0.05) # sleep 50 msec