]> granicus.if.org Git - vim/commitdiff
patch 7.4.2248 v7.4.2248
authorBram Moolenaar <Bram@vim.org>
Wed, 24 Aug 2016 19:21:26 +0000 (21:21 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 24 Aug 2016 19:21:26 +0000 (21:21 +0200)
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.

src/tag.c
src/testdir/runtest.vim
src/testdir/test_tagjump.vim
src/version.c

index 8fe213d6d59f3ae7c2e979723871ccf7d82ff85a..f772c833d647b327fb2bb9c867ef3f2299ba63d1 100644 (file)
--- 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
index 8f0c0c3c80c9c4cd85f5aa179c74afbcdd26123d..2660d93e8ac2c083bb92544ce50e139cf37e1d30 100644 (file)
@@ -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
index b22bde8047cbb3849e8006536b632fb0ba1291ce..678ad0ada878fb2bdfbaddaebbd2d5de73c4c7f1 100644 (file)
@@ -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\<CR>\<CR>", "xt")
+  help
+  call assert_equal(2, winnr('$'))
+
+  call delete('Xtags')
+  quit
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 0a96e68d5be0d0ed71f9ee5ed224ce9b4e38cf41..8b9818efa275941b6f85e4f545ecc4616ea0c9fe 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2248,
 /**/
     2247,
 /**/