Skip to content

Commit

Permalink
fix(view): need some minor delay to ensure job started
Browse files Browse the repository at this point in the history
refer: #2972
  • Loading branch information
lervag committed Jun 24, 2024
1 parent 8ed9456 commit 2dc2a54
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion autoload/vimtex/jobs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ function! vimtex#jobs#start(cmd, ...) abort " {{{1
let l:job.wait_timeout = str2nr(get(l:opts, 'wait_timeout', 5000))
let l:job.capture_output = get(l:opts, 'capture_output', v:false)
let l:job.detached = get(l:opts, 'detached', v:false)
call l:job.start()

return l:job.start()
" Add some minor delay to ensure the job was properly started
sleep 100m

return l:job
endfunction

" }}}1
Expand Down
2 changes: 1 addition & 1 deletion autoload/vimtex/jobs/neovim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function! vimtex#jobs#neovim#new(cmd) abort " {{{1
let l:job = deepcopy(s:job)
let l:job.cmd = has('win32')
\ ? 'cmd /s /c "' . a:cmd . '"'
\ : ['sh', '-c', a:cmd]
\ : ['/bin/sh', '-c', a:cmd]
return l:job
endfunction

Expand Down
2 changes: 1 addition & 1 deletion autoload/vimtex/jobs/vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function! vimtex#jobs#vim#new(cmd) abort " {{{1
let l:job = deepcopy(s:job)
let l:job.cmd = has('win32')
\ ? 'cmd /s /c "' . a:cmd . '"'
\ : ['sh', '-c', a:cmd]
\ : ['/bin/sh', '-c', a:cmd]
return l:job
endfunction

Expand Down
1 change: 1 addition & 0 deletions autoload/vimtex/view/mupdf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ endfunction
function! s:viewer._forward_search(outfile) dict abort " {{{1
if !executable('xdotool') | return | endif
if !executable('synctex') | return | endif
if self.xwin_id <= 0 | return | endif

let self.cmd_synctex_view = 'synctex view -i '
\ . (line('.') + 1) . ':'
Expand Down

0 comments on commit 2dc2a54

Please sign in to comment.