Use system(...) to avoid redraw (fixes #142)

This commit is contained in:
Karl Yngve Lervåg 2015-04-02 20:06:57 +02:00
parent f70279c4ed
commit 2a15ff0bc1
2 changed files with 16 additions and 6 deletions

View File

@ -194,6 +194,7 @@ function! s:bibtex_search(regexp) " {{{2
let exe = {}
let exe.cmd = 'bibtex -terse ' . tmp.aux
let exe.bg = 0
let exe.system = 1
call vimtex#util#execute(exe)
" Parse temporary bbl file

View File

@ -113,6 +113,7 @@ function! vimtex#util#execute(exe) " {{{1
let bg = has_key(a:exe, 'bg') ? a:exe.bg : 1
let silent = has_key(a:exe, 'silent') ? a:exe.silent : 1
let null = has_key(a:exe, 'null') ? a:exe.null : 1
let system = has_key(a:exe, 'system') ? a:exe.system : 0
" Change directory if wanted
if has_key(a:exe, 'wd')
@ -145,14 +146,22 @@ function! vimtex#util#execute(exe) " {{{1
set shellquote& shellpipe& shellredir& shellslash&
endif
if silent
silent execute '!' cmd
if system
if silent
silent call system(cmd)
else
call system(cmd)
endif
else
execute '!' cmd
endif
if silent
silent execute '!' cmd
else
execute '!' cmd
endif
if !has("gui_running")
redraw!
if !has("gui_running")
redraw!
endif
endif
if has('win32') && exists('savedShell')