summaryrefslogtreecommitdiffstats
path: root/autoload/vimtex/view/zathura.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-04-28 01:09:08 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-04-28 01:09:08 +0200
commitc7b5826d53f3f4fe31e8168e1d8c6d7b19e60f4b (patch)
tree18b7ceacc639cd998d9ea1b82dc6ec330bea4a4b /autoload/vimtex/view/zathura.vim
parent1d348d0c2db81becf134d86d0513b840e7d66435 (diff)
downloadvim-polyglot-c7b5826d53f3f4fe31e8168e1d8c6d7b19e60f4b.tar.gz
vim-polyglot-c7b5826d53f3f4fe31e8168e1d8c6d7b19e60f4b.zip
Update
Diffstat (limited to 'autoload/vimtex/view/zathura.vim')
-rw-r--r--autoload/vimtex/view/zathura.vim21
1 files changed, 10 insertions, 11 deletions
diff --git a/autoload/vimtex/view/zathura.vim b/autoload/vimtex/view/zathura.vim
index 48e8e27a..98419981 100644
--- a/autoload/vimtex/view/zathura.vim
+++ b/autoload/vimtex/view/zathura.vim
@@ -90,21 +90,20 @@ function! s:zathura.compiler_callback(status) dict abort " {{{1
if !filereadable(self.out()) | return | endif
- if g:vimtex_view_automatic
+ if g:vimtex_view_automatic && !has_key(self, 'started_through_callback')
"
" Search for existing window created by latexmk
- " It may be necessary to wait some time before it is opened and
- " recognized. Sometimes it is very quick, other times it may take
- " a second. This way, we don't block longer than necessary.
+ " Note: It may be necessary to wait some time before it is opened and
+ " recognized. Sometimes it is very quick, other times it may take
+ " a second. This way, we don't block longer than necessary.
"
- if !has_key(self, 'started_through_callback')
- for l:dummy in range(30)
- sleep 50m
- if self.xwin_exists() | break | endif
- endfor
- endif
+ for l:dummy in range(30)
+ let l:xwin_exists = self.xwin_exists()
+ if l:xwin_exists | break | endif
+ sleep 50m
+ endfor
- if !self.xwin_exists() && !has_key(self, 'started_through_callback')
+ if ! l:xwin_exists
call self.start(self.out())
let self.started_through_callback = 1
endif