summaryrefslogtreecommitdiffstats
path: root/autoload
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
parent1d348d0c2db81becf134d86d0513b840e7d66435 (diff)
downloadvim-polyglot-c7b5826d53f3f4fe31e8168e1d8c6d7b19e60f4b.tar.gz
vim-polyglot-c7b5826d53f3f4fe31e8168e1d8c6d7b19e60f4b.zip
Update
Diffstat (limited to 'autoload')
-rw-r--r--autoload/vimtex/include.vim2
-rw-r--r--autoload/vimtex/re.vim2
-rw-r--r--autoload/vimtex/syntax/load.vim4
-rw-r--r--autoload/vimtex/view/common.vim5
-rw-r--r--autoload/vimtex/view/zathura.vim21
5 files changed, 20 insertions, 14 deletions
diff --git a/autoload/vimtex/include.vim b/autoload/vimtex/include.vim
index 2a58dffe..830292c5 100644
--- a/autoload/vimtex/include.vim
+++ b/autoload/vimtex/include.vim
@@ -63,6 +63,8 @@ function! s:input(fname, type) abort " {{{1
if l:lnum == 0 | return a:fname | endif
let l:cmd = vimtex#cmd#get_at(l:lnum, l:cnum)
+ if empty(l:cmd) | return a:fname | endif
+
let l:file = join(map(
\ get(l:cmd, 'args', [{}]),
\ "get(v:val, 'text', '')"),
diff --git a/autoload/vimtex/re.vim b/autoload/vimtex/re.vim
index 0b3aab58..8e8f38be 100644
--- a/autoload/vimtex/re.vim
+++ b/autoload/vimtex/re.vim
@@ -20,7 +20,7 @@ let g:vimtex#re#tex_input_import =
let g:vimtex#re#tex_input_package =
\ '\v\\%(usepackage|RequirePackage)%(\s*\[[^]]*\])?\s*\{\zs[^}]*\ze\}'
-let g:vimtex#re#tex_input = '\v^\s*%(' . join([
+let g:vimtex#re#tex_input = '\v^\s*\zs%(' . join([
\ g:vimtex#re#tex_input_latex,
\ g:vimtex#re#tex_input_import,
\ ], '|') . ')'
diff --git a/autoload/vimtex/syntax/load.vim b/autoload/vimtex/syntax/load.vim
index d1b8b09b..5008e24a 100644
--- a/autoload/vimtex/syntax/load.vim
+++ b/autoload/vimtex/syntax/load.vim
@@ -7,6 +7,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'latex') == -1
"
function! vimtex#syntax#load#general() abort " {{{1
+ if !exists('b:vimtex_syntax') | return | endif
+
" I don't see why we can't match Math zones in the MatchNMGroup
if !exists('g:tex_no_math')
syntax cluster texMatchNMGroup add=@texMathZones
@@ -64,6 +66,8 @@ endfunction
" }}}1
function! vimtex#syntax#load#packages() abort " {{{1
+ if !exists('b:vimtex_syntax') | return | endif
+
try
call vimtex#syntax#p#{b:vimtex.documentclass}#load()
catch /E117:/
diff --git a/autoload/vimtex/view/common.vim b/autoload/vimtex/view/common.vim
index ca39cf0a..348dc899 100644
--- a/autoload/vimtex/view/common.vim
+++ b/autoload/vimtex/view/common.vim
@@ -153,9 +153,10 @@ function! s:xwin_template.xwin_exists() dict abort " {{{1
" If xwin_id is unset, check if matching viewer windows exist
"
if self.xwin_id == 0
- if has_key(self, 'get_pid')
+ let l:pid = has_key(self, 'get_pid') ? self.get_pid() : 0
+ if l:pid > 0
let cmd = 'xdotool search'
- \ . ' --all --pid ' . self.get_pid()
+ \ . ' --all --pid ' . l:pid
\ . ' --name ' . fnamemodify(self.out(), ':t')
let self.xwin_id = get(split(system(cmd), '\n'), 0)
else
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