-
-
Save kamichidu/5784087 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:P= vital#of('vital').import('ProcessManager') | |
if !g:P.is_available() | |
throw 'omg' | |
endif | |
" ProcessManager intented to manage interactive processes, | |
" thus sort prg isn't good example. | |
let g:p= g:P.new('erl') | |
echo g:P.read_wait(g:p, 4.0, ['>']) | |
let g:stat= g:P.status(g:p) | |
echo 'g:stat: '.g:stat | |
echo g:P.read(g:p, []) | |
let g:stat= g:P.status(g:p) | |
echo 'g:stat: '.g:stat | |
call g:P.writeln(g:p, 'e') | |
call g:P.writeln(g:p, 'd') | |
call g:P.writeln(g:p, 'c') | |
call g:P.writeln(g:p, 'b') | |
call g:P.writeln(g:p, 'a') | |
" call g:P.write(g:p, "\x1a") | |
" "\x04" vs '\x04', see :h expr-quote and :h expr-' | |
call g:P.write(g:p, "\x04") | |
" which one is eof character, "\x04" and "\x1a"? | |
call g:P.read_wait(g:p, 1.0, []) " ['', '', 'timedout'] | |
let g:stat= g:P.status(g:p) | |
echo 'g:stat: '.g:stat | |
let g:stat= g:P.status(g:p) | |
echo 'g:stat: '.g:stat | |
call g:P.stop(g:p) | |
try | |
let g:stat= g:P.status(g:p) | |
catch /ProcessManager/ | |
echo 'thrown' | |
endtry | |
" vim:ft=vim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment