DISABLE FDs (REMOVE ME).
[jackhill/mal.git] / vimscript / readline.vim
CommitLineData
50a964ce
DM
1function PrintLn(str)
2 let lines = split(a:str, "\n", 1)
3 call writefile(lines, "/dev/stdout", "a")
4endfunction
5
6function s:buildlibvimreadline()
d831996c
DM
7 if !filereadable("libvimextras.so")
8 call system("make libvimextras.so")
50a964ce
DM
9 endif
10endfunction
11
12" Returns [is_eof, line_string]
13function Readline(prompt)
ab1c5d94
DM
14 " Use the vimreadline() function defined in vimextras.c and compiled
15 " into libvimextras.so
50a964ce 16 call s:buildlibvimreadline()
d831996c 17 let res = libcall("libvimextras.so", "vimreadline", a:prompt)
50a964ce
DM
18 if res[0] == "E"
19 return [1, ""]
20 else
21 return [0, res[1:]]
22 endif
23endfunction