Write the tempfile into /tmp/*. This is still a temporary solution.
This commit is contained in:
baabelfish 2016-02-06 21:31:25 +02:00
commit 679179c578
2 changed files with 14 additions and 2 deletions

View file

@ -19,10 +19,9 @@ function! omni#nim(findstart, base)
else
let file = expand("%:p")
let tempfile = file . ".temp"
let tempfile = util#WriteMemfile()
let l = line(".")
let c = col(".")
call writefile(getline(1, '$'), tempfile)
let query = "sug " . file . ";" . tempfile . ":" . l . ":" . c
let jobcmdstr = g:nvim_nim_exec_nimsuggest . " --v2 --stdin " . file

View file

@ -53,6 +53,19 @@ function! util#CheckDependency(command)
endfunction
function! util#MemFilePath(file)
return "/tmp/nvimnvimtemp" . substitute(a:file, "\/", "_-_", "g")
endfunction
"" Writes current buffer into a memfile
function! util#WriteMemfile()
let memfile = util#MemFilePath(expand("%:p"))
call writefile(getline(1, '$'), memfile)
return memfile
endfunction
function! util#JumpToWindow(window, line, col)
execute ":" . a:window . "wincmd w"
execute ":" . a:line