aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/runtest.vim11
-rw-r--r--src/nvim/testdir/test_tagjump.vim16
2 files changed, 26 insertions, 1 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim
index 5299fec7c2..0403a53f9c 100644
--- a/src/nvim/testdir/runtest.vim
+++ b/src/nvim/testdir/runtest.vim
@@ -95,8 +95,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/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim
index b22bde8047..678ad0ada8 100644
--- a/src/nvim/testdir/test_tagjump.vim
+++ b/src/nvim/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\<CR>\<CR>", "xt")
+ help
+ call assert_equal(2, winnr('$'))
+
+ call delete('Xtags')
+ quit
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab