From 2a849ee67ad623c73e9cbf1a7d4540b671b44298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Thu, 4 Aug 2016 21:31:29 +0200 Subject: [PATCH] Improved latexmk callbacks for mupdf/zathura --- autoload/vimtex/view.vim | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/autoload/vimtex/view.vim b/autoload/vimtex/view.vim index 9518821..a8dee6a 100644 --- a/autoload/vimtex/view.vim +++ b/autoload/vimtex/view.vim @@ -281,14 +281,13 @@ endfunction " }}}2 function! s:mupdf.latexmk_callback(status) dict " {{{2 - if !self.xwin_exists() - if self.xwin_get_id() - call self.xwin_send_keys(g:vimtex_view_mupdf_send_keys) - call self.forward_search(b:vimtex.out()) - if has_key(self, 'hook_callback') - call self.hook_callback() - endif - endif + sleep 500m + if !self.xwin_exists() | return | endif + + call self.xwin_send_keys(g:vimtex_view_mupdf_send_keys) + call self.forward_search(b:vimtex.out()) + if has_key(self, 'hook_callback') + call self.hook_callback() endif endfunction @@ -379,13 +378,12 @@ endfunction " }}}2 function! s:zathura.latexmk_callback(status) dict " {{{2 - if !self.xwin_exists() - if self.xwin_get_id() - call self.forward_search(b:vimtex.out()) - if has_key(self, 'hook_callback') - call self.hook_callback() - endif - endif + sleep 500m + if !self.xwin_exists() | return | endif + + call self.forward_search(b:vimtex.out()) + if has_key(self, 'hook_callback') + call self.hook_callback() endif endfunction