Fix the rest of tempfiles

This commit is contained in:
baabelfish 2016-02-07 19:01:10 +02:00
commit 038797c6da
2 changed files with 5 additions and 11 deletions

View file

@ -102,9 +102,9 @@ function highlighter#New()
let result.lines = []
let result.job = jobstart([g:nvim_nim_exec_nimsuggest, '--v2', '--stdin', expand("%:p")], result)
let result.file = expand("%:p")
let tempfile = result.file . ".temp"
call writefile(getline(1, '$'), tempfile)
call jobsend(result.job, "highlight " . result.file . ";" . tempfile . ":1:1\nquit\n")
let result.tempfile = util#WriteMemfile()
call jobsend(result.job, "highlight " . result.file . ";" . result.tempfile . ":1:1\nquit\n")
if !exists("b:highlights")
let b:highlights = []
endif

View file

@ -53,18 +53,12 @@ function! suggest#NewKnown(command, sync, useV2, file, line, col, handler)
let result = copy(s:NimSuggest)
let result.lines = []
let result.file = a:file
let result.tempfile = result.file . ".temp"
let result.line = a:line
let result.col = a:col
let result.handler = a:handler
let result.isAsync = has("nvim") && !a:sync && g:nvim_nim_enable_async
" if a:useTempFile
" call writefile(getline(1, '$'), result.tempfile)
" endif
" let nimcom = completion . " " . file . (a:useTempFile ? (";" . result.tempfile) : "") . ":" . line . ":" . col
let query = a:command . " " . result.file . ":" . result.line . ":" . result.col
let result.tempfile = util#WriteMemfile()
let query = a:command . " " . result.file . ";" . result.tempfile . ":" . result.line . ":" . result.col
if !result.isAsync
let jobcmdstr = g:nvim_nim_exec_nimsuggest . " " . (a:useV2 ? '--v2' : '') . " " . '--stdin' . " " . result.file