From 01638100654258cbab36dfed3734453fdd4ed059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Thu, 4 Aug 2016 21:30:24 +0200 Subject: [PATCH] Some minor code cleaning --- autoload/vimtex/view.vim | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/autoload/vimtex/view.vim b/autoload/vimtex/view.vim index f38e2ea..9518821 100644 --- a/autoload/vimtex/view.vim +++ b/autoload/vimtex/view.vim @@ -186,10 +186,10 @@ function! s:mupdf.view(file) dict " {{{2 let outfile = a:file !=# '' ? a:file : b:vimtex.out() if s:output_not_readable(outfile) | return | endif - if !self.xwin_exists() - call self.start(outfile) - else + if self.xwin_exists() call self.forward_search(outfile) + else + call self.start(outfile) endif if has_key(self, 'hook_view') @@ -244,8 +244,7 @@ function! s:mupdf.reverse_search() dict " {{{2 if s:output_not_readable(outfile) | return | endif if !self.xwin_exists() - call vimtex#echo#warning( - \ 'reverse search failed (is MuPDF open?)') + call vimtex#echo#warning('reverse search failed (is MuPDF open?)') return endif @@ -339,10 +338,10 @@ function! s:zathura.view(file) dict " {{{2 let outfile = a:file !=# '' ? a:file : b:vimtex.out() if s:output_not_readable(outfile) | return | endif - if !self.xwin_exists() - call self.start(outfile) - else + if self.xwin_exists() call self.forward_search(outfile) + else + call self.start(outfile) endif if has_key(self, 'hook_view') @@ -459,8 +458,7 @@ function! s:xwin_exists() dict " {{{1 " If xwin_id is unset, check if matching viewer windows exist " if self.xwin_id == 0 - let cmd = 'xdotool search' - \ . ' --name ' . fnamemodify(b:vimtex.out(), ':t') + let cmd = 'xdotool search --name ' . fnamemodify(b:vimtex.out(), ':t') let result = split(system(cmd), '\n') if len(result) > 0 let self.xwin_id = result[-1]