From 9132e9d50db0cefd2936dd878a2211e93b2be2ad Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 21 Jul 2014 02:49:47 +0900 Subject: [PATCH] Workaround for screen freeze in MacVim GUI (#36) --- plug.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plug.vim b/plug.vim index ea5dfee..d360d07 100644 --- a/plug.vim +++ b/plug.vim @@ -705,6 +705,15 @@ function! s:update_parallel(pull, todo, threads) threads.each { |t| t.join rescue nil } main.kill } + refresh = Thread.new { + while true + mtx.synchronize do + break unless running + VIM::command('normal! a') + end + sleep 0.2 + end + } if VIM::evaluate('has("mac") && has("gui_running")') == 1 processed = Set.new progress = iswin ? '' : '--progress' @@ -762,6 +771,7 @@ function! s:update_parallel(pull, todo, threads) all.merge!(extended) logh.call end + refresh.kill if refresh watcher.kill $curbuf[1] = "Updated. Elapsed time: #{"%.6f" % (Time.now - st)} sec." EOF