From 5d41f485967eb8a8cd80430aa0974c878460b192 Mon Sep 17 00:00:00 2001 From: Martin Vuille Date: Sat, 15 Oct 2016 10:58:08 -0400 Subject: [PATCH] Check all tabs for location list window --- src/quickfix.c | 2 +- src/testdir/test_quickfix.vim | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/quickfix.c b/src/quickfix.c index 9139663483f624..5bd1257200d1f6 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2266,7 +2266,7 @@ qf_jump( ok = buflist_getfile(qf_ptr->qf_fnum, (linenr_T)1, GETF_SETMARK | GETF_SWITCH, forceit); - if (qi != &ql_info && !win_valid(oldwin)) + if (qi != &ql_info && !win_valid_any_tab(oldwin)) { EMSG(_("E924: Current window was closed")); is_abort = TRUE; diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 73ca7ca8a65d48..022c12a292fa4a 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -617,6 +617,22 @@ function Test_locationlist_curwin_was_closed() augroup! testgroup endfunction +function Test_locationlist_cross_tab_jump() + call writefile(['loclistfoo'], 'loclistfoo') + call writefile(['loclistbar'], 'loclistbar') + set switchbuf=usetab + + edit loclistfoo + tabedit loclistbar + silent lgrep loclistfoo loclist* + call assert_equal(1, tabpagenr()) + + enew | only | tabonly + set switchbuf&vim + call delete('loclistfoo') + call delete('loclistbar') +endfunction + " More tests for 'errorformat' function! Test_efm1() if !has('unix')