diff src/testdir/test_tagjump.vim @ 18293:1c5974759bcd v8.1.2141

patch 8.1.2141: :tselect has an extra hit-enter prompt Commit: https://github.com/vim/vim/commit/e8070987c6ca9b1e14c5305707c6d29c8e58e7c4 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 12 17:07:06 2019 +0200 patch 8.1.2141: :tselect has an extra hit-enter prompt Problem: :tselect has an extra hit-enter prompt. Solution: Do not set need_wait_return when only moving the cursor. (closes #5040)
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Oct 2019 17:15:04 +0200
parents 7a19c8d6bb9e
children b0b37bd807ba
line wrap: on
line diff
--- a/src/testdir/test_tagjump.vim
+++ b/src/testdir/test_tagjump.vim
@@ -1,5 +1,8 @@
 " Tests for tagjump (tags and special searches)
 
+source check.vim
+source screendump.vim
+
 " SEGV occurs in older versions.  (At least 7.4.1748 or older)
 func Test_ptag_with_notagstack()
   set notagstack
@@ -473,4 +476,34 @@ func Test_tag_line_toolong()
   let &verbose = old_vbs
 endfunc
 
+" Check that using :tselect does not run into the hit-enter prompt.
+" Requires a terminal to trigger that prompt.
+func Test_tselect()
+  CheckScreendump
+
+  call writefile([
+	\ 'main	Xtest.h	/^void test();$/;"	f',
+	\ 'main	Xtest.c	/^int main()$/;"	f',
+	\ 'main	Xtest.x	/^void test()$/;"	f',
+	\ ], 'Xtags')
+  cal writefile([
+	\ 'int main()',
+	\ 'void test()',
+	\ ], 'Xtest.c')
+
+  let lines =<< trim [SCRIPT]
+    set tags=Xtags
+  [SCRIPT]
+  call writefile(lines, 'XTest_tselect')
+  let buf = RunVimInTerminal('-S XTest_tselect', {'rows': 10, 'cols': 50})
+
+  call term_wait(buf, 100)
+  call term_sendkeys(buf, ":tselect main\<CR>2\<CR>")
+  call VerifyScreenDump(buf, 'Test_tselect_1', {})
+
+  call delete('Xtags')
+  call delete('Xtest.c')
+  call delete('XTest_tselect')
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab