# HG changeset patch # User Christian Brabandt # Date 1472067006 -7200 # Node ID 30be4b26a37ec042109c0e7b07b9d4b46df56070 # Parent f3f3094281178d9ef3c54a7caacb1a72b91f9549 commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe Author: Bram Moolenaar Date: Wed Aug 24 21:21:26 2016 +0200 patch 7.4.2248 Problem: When cancelling the :ptjump prompt a preview window is opened for a following command. Solution: Reset g_do_tagpreview. (Hirohito Higashi) Add a test. Avoid that the test runner gets stuck in trying to close a window. diff --git a/src/tag.c b/src/tag.c --- a/src/tag.c +++ b/src/tag.c @@ -1078,6 +1078,9 @@ end_do_tag: curwin->w_tagstackidx = tagstackidx; #ifdef FEAT_WINDOWS postponed_split = 0; /* don't split next time */ +# ifdef FEAT_QUICKFIX + g_do_tagpreview = 0; /* don't do tag preview next time */ +# endif #endif #ifdef FEAT_CSCOPE diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -105,8 +105,17 @@ function RunTheTest(test) endif " Close any extra windows and make the current one not modified. - while winnr('$') > 1 + while 1 + let wincount = winnr('$') + if wincount == 1 + break + endif bwipe! + if wincount == winnr('$') + " Did not manage to close a window. + only! + break + endif endwhile set nomodified endfunc diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim --- a/src/testdir/test_tagjump.vim +++ b/src/testdir/test_tagjump.vim @@ -7,4 +7,20 @@ func Test_ptag_with_notagstack() set tagstack&vim endfunc +func Test_cancel_ptjump() + set tags=Xtags + call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", + \ "word\tfile1\tcmd1", + \ "word\tfile2\tcmd2"], + \ 'Xtags') + + only! + call feedkeys(":ptjump word\\", "xt") + help + call assert_equal(2, winnr('$')) + + call delete('Xtags') + quit +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2248, +/**/ 2247, /**/ 2246,