Fixes #25
Write the tempfile into /tmp/*. This is still a temporary solution.
This commit is contained in:
parent
b76d724a5e
commit
679179c578
2 changed files with 14 additions and 2 deletions
|
|
@ -19,10 +19,9 @@ function! omni#nim(findstart, base)
|
||||||
else
|
else
|
||||||
|
|
||||||
let file = expand("%:p")
|
let file = expand("%:p")
|
||||||
let tempfile = file . ".temp"
|
let tempfile = util#WriteMemfile()
|
||||||
let l = line(".")
|
let l = line(".")
|
||||||
let c = col(".")
|
let c = col(".")
|
||||||
call writefile(getline(1, '$'), tempfile)
|
|
||||||
|
|
||||||
let query = "sug " . file . ";" . tempfile . ":" . l . ":" . c
|
let query = "sug " . file . ";" . tempfile . ":" . l . ":" . c
|
||||||
let jobcmdstr = g:nvim_nim_exec_nimsuggest . " --v2 --stdin " . file
|
let jobcmdstr = g:nvim_nim_exec_nimsuggest . " --v2 --stdin " . file
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,19 @@ function! util#CheckDependency(command)
|
||||||
endfunction
|
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)
|
function! util#JumpToWindow(window, line, col)
|
||||||
execute ":" . a:window . "wincmd w"
|
execute ":" . a:window . "wincmd w"
|
||||||
execute ":" . a:line
|
execute ":" . a:line
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue