From c79e7afb3b00d142b24aa4f137512d67ef2b28b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Wed, 14 Dec 2016 20:17:18 +0100 Subject: [PATCH] Fix #637: Jump back to the right window --- autoload/vimtex/latexmk.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/vimtex/latexmk.vim b/autoload/vimtex/latexmk.vim index 939d192..8292048 100644 --- a/autoload/vimtex/latexmk.vim +++ b/autoload/vimtex/latexmk.vim @@ -359,6 +359,9 @@ function! vimtex#latexmk#errors_open(force) " {{{1 let s:qf_main = b:vimtex.tex let s:qf_root = b:vimtex.root + " Store winnr of current window in order to jump back later + let winnr = winnr() + if g:vimtex_quickfix_autojump execute 'cfile ' . fnameescape(log) else @@ -386,7 +389,7 @@ function! vimtex#latexmk#errors_open(force) " {{{1 if s:open_quickfix_window botright cwindow if g:vimtex_quickfix_mode == 2 - wincmd p + execute winnr . 'wincmd p' endif redraw endif