Avoid Windows command prompt popups when possible.

Before this commit some Windows users saw the command prompt pop
up briefly, and/or the taskbar flicker, every time the plugin ran.

Now the plugin will use xolox's vim-shell and vim-misc, if they are
available and we are on Windows, to execute external commands.  Xolox's
clever plugins avoid the command prompt popup and taskbar flicker.

Windows users with those plugins installed can opt out by setting a
variable in their vimrc.

Many thanks to @suxpert for the initial code.
This commit is contained in:
Andy Stewart
2014-06-19 10:45:40 +02:00
parent 7ac9d059f8
commit a2aa2b1100
5 changed files with 47 additions and 7 deletions

View File

@@ -31,12 +31,12 @@ function! diff#run_diff(realtime, use_external_grep)
let cmd .= '))'
if a:realtime
let diff = system(utility#command_in_directory_of_file(cmd), utility#buffer_contents())
let diff = utility#system(utility#command_in_directory_of_file(cmd), utility#buffer_contents())
else
let diff = system(utility#command_in_directory_of_file(cmd))
let diff = utility#system(utility#command_in_directory_of_file(cmd))
endif
if v:shell_error
if utility#shell_error()
" A shell error indicates the file is not tracked by git (unless something
" bizarre is going on).
throw 'diff failed'