diff src/testdir/test_search.vim @ 9990:6a1793d9c895 v7.4.2268

commit https://github.com/vim/vim/commit/1195669f9e434fa9ab8b57ee9470bf951e4990b8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 27 16:26:56 2016 +0200 patch 7.4.2268 Problem: Using CTRL-N and CTRL-P for incsearch shadows completion keys. Solution: Use CTRL-T and CTRL-G instead.
author Christian Brabandt <cb@256bit.org>
date Sat, 27 Aug 2016 16:30:06 +0200
parents 98b39d2eb895
children 72e4b7f90465
line wrap: on
line diff
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -16,11 +16,11 @@ func Test_search_cmdline()
   call feedkeys("/foobar\<cr>", 'tx')
   call feedkeys("/the\<cr>",'tx')
   call assert_equal('the', @/)
-  call feedkeys("/thes\<c-p>\<c-p>\<cr>",'tx')
+  call feedkeys("/thes\<C-P>\<C-P>\<cr>",'tx')
   call assert_equal('foobar', @/)
 
   " Test 2
-  " Ctrl-N goes from one match to the next
+  " Ctrl-G goes from one match to the next
   " until the end of the buffer
   set incsearch nowrapscan
   :1
@@ -29,39 +29,39 @@ func Test_search_cmdline()
   call assert_equal('  2 these', getline('.'))
   :1
   " second match
-  call feedkeys("/the\<c-n>\<cr>", 'tx')
+  call feedkeys("/the\<C-G>\<cr>", 'tx')
   call assert_equal('  3 the', getline('.'))
   :1
   " third match
-  call feedkeys("/the".repeat("\<c-n>", 2)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 2)."\<cr>", 'tx')
   call assert_equal('  4 their', getline('.'))
   :1
   " fourth match
-  call feedkeys("/the".repeat("\<c-n>", 3)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 3)."\<cr>", 'tx')
   call assert_equal('  5 there', getline('.'))
   :1
   " fifth match
-  call feedkeys("/the".repeat("\<c-n>", 4)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 4)."\<cr>", 'tx')
   call assert_equal('  6 their', getline('.'))
   :1
   " sixth match
-  call feedkeys("/the".repeat("\<c-n>", 5)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 5)."\<cr>", 'tx')
   call assert_equal('  7 the', getline('.'))
   :1
   " seventh match
-  call feedkeys("/the".repeat("\<c-n>", 6)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 6)."\<cr>", 'tx')
   call assert_equal('  8 them', getline('.'))
   :1
   " eigth match
-  call feedkeys("/the".repeat("\<c-n>", 7)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 7)."\<cr>", 'tx')
   call assert_equal('  9 these', getline('.'))
   :1
   " no further match
-  call feedkeys("/the".repeat("\<c-n>", 8)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 8)."\<cr>", 'tx')
   call assert_equal('  9 these', getline('.'))
 
   " Test 3
-  " Ctrl-N goes from one match to the next
+  " Ctrl-G goes from one match to the next
   " and continues back at the top
   set incsearch wrapscan
   :1
@@ -70,39 +70,39 @@ func Test_search_cmdline()
   call assert_equal('  2 these', getline('.'))
   :1
   " second match
-  call feedkeys("/the\<c-n>\<cr>", 'tx')
+  call feedkeys("/the\<C-G>\<cr>", 'tx')
   call assert_equal('  3 the', getline('.'))
   :1
   " third match
-  call feedkeys("/the".repeat("\<c-n>", 2)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 2)."\<cr>", 'tx')
   call assert_equal('  4 their', getline('.'))
   :1
   " fourth match
-  call feedkeys("/the".repeat("\<c-n>", 3)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 3)."\<cr>", 'tx')
   call assert_equal('  5 there', getline('.'))
   :1
   " fifth match
-  call feedkeys("/the".repeat("\<c-n>", 4)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 4)."\<cr>", 'tx')
   call assert_equal('  6 their', getline('.'))
   :1
   " sixth match
-  call feedkeys("/the".repeat("\<c-n>", 5)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 5)."\<cr>", 'tx')
   call assert_equal('  7 the', getline('.'))
   :1
   " seventh match
-  call feedkeys("/the".repeat("\<c-n>", 6)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 6)."\<cr>", 'tx')
   call assert_equal('  8 them', getline('.'))
   :1
   " eigth match
-  call feedkeys("/the".repeat("\<c-n>", 7)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 7)."\<cr>", 'tx')
   call assert_equal('  9 these', getline('.'))
   :1
   " back at first match
-  call feedkeys("/the".repeat("\<c-n>", 8)."\<cr>", 'tx')
+  call feedkeys("/the".repeat("\<C-G>", 8)."\<cr>", 'tx')
   call assert_equal('  2 these', getline('.'))
 
   " Test 4
-  " CTRL-P goes to the previous match
+  " CTRL-T goes to the previous match
   set incsearch nowrapscan
   $
   " first match
@@ -110,23 +110,23 @@ func Test_search_cmdline()
   call assert_equal('  9 these', getline('.'))
   $
   " first match
-  call feedkeys("?the\<c-n>\<cr>", 'tx')
+  call feedkeys("?the\<C-G>\<cr>", 'tx')
   call assert_equal('  9 these', getline('.'))
   $
   " second match
-  call feedkeys("?the".repeat("\<c-p>", 1)."\<cr>", 'tx')
+  call feedkeys("?the".repeat("\<C-T>", 1)."\<cr>", 'tx')
   call assert_equal('  8 them', getline('.'))
   $
   " last match
-  call feedkeys("?the".repeat("\<c-p>", 7)."\<cr>", 'tx')
+  call feedkeys("?the".repeat("\<C-T>", 7)."\<cr>", 'tx')
   call assert_equal('  2 these', getline('.'))
   $
   " last match
-  call feedkeys("?the".repeat("\<c-p>", 8)."\<cr>", 'tx')
+  call feedkeys("?the".repeat("\<C-T>", 8)."\<cr>", 'tx')
   call assert_equal('  2 these', getline('.'))
 
   " Test 5
-  " CTRL-P goes to the previous match
+  " CTRL-T goes to the previous match
   set incsearch wrapscan
   $
   " first match
@@ -134,19 +134,19 @@ func Test_search_cmdline()
   call assert_equal('  9 these', getline('.'))
   $
   " first match at the top
-  call feedkeys("?the\<c-n>\<cr>", 'tx')
+  call feedkeys("?the\<C-G>\<cr>", 'tx')
   call assert_equal('  2 these', getline('.'))
   $
   " second match
-  call feedkeys("?the".repeat("\<c-p>", 1)."\<cr>", 'tx')
+  call feedkeys("?the".repeat("\<C-T>", 1)."\<cr>", 'tx')
   call assert_equal('  8 them', getline('.'))
   $
   " last match
-  call feedkeys("?the".repeat("\<c-p>", 7)."\<cr>", 'tx')
+  call feedkeys("?the".repeat("\<C-T>", 7)."\<cr>", 'tx')
   call assert_equal('  2 these', getline('.'))
   $
   " back at the bottom of the buffer
-  call feedkeys("?the".repeat("\<c-p>", 8)."\<cr>", 'tx')
+  call feedkeys("?the".repeat("\<C-T>", 8)."\<cr>", 'tx')
   call assert_equal('  9 these', getline('.'))
 
   " Test 6
@@ -158,16 +158,16 @@ func Test_search_cmdline()
   call assert_equal('  2 these', getline('.'))
   1
   " go to next match of 'thes'
-  call feedkeys("/the\<c-l>\<c-n>\<cr>", 'tx')
+  call feedkeys("/the\<c-l>\<C-G>\<cr>", 'tx')
   call assert_equal('  9 these', getline('.'))
   1
   " wrap around
-  call feedkeys("/the\<c-l>\<c-n>\<c-n>\<cr>", 'tx')
+  call feedkeys("/the\<c-l>\<C-G>\<C-G>\<cr>", 'tx')
   call assert_equal('  2 these', getline('.'))
   1
   " wrap around
   set nowrapscan
-  call feedkeys("/the\<c-l>\<c-n>\<c-n>\<cr>", 'tx')
+  call feedkeys("/the\<c-l>\<C-G>\<C-G>\<cr>", 'tx')
   call assert_equal('  9 these', getline('.'))
 
   " Test 7
@@ -183,7 +183,7 @@ func Test_search_cmdline()
   call assert_equal('  9 these', getline('.'))
   1
   " delete one char, add another,  go to previous match, add one char
-  call feedkeys("/thei\<bs>s\<bs>\<c-p>\<c-l>\<cr>", 'tx')
+  call feedkeys("/thei\<bs>s\<bs>\<C-T>\<c-l>\<cr>", 'tx')
   call assert_equal('  8 them', getline('.'))
   1
   " delete all chars, start from the beginning again
@@ -205,7 +205,7 @@ func Test_search_cmdline2()
   new
   call setline(1, ['  1', '  2 these', '  3 the theother'])
   " Test 1
-  " Ctrl-P goes correctly back and forth
+  " Ctrl-T goes correctly back and forth
   set incsearch
   1
   " first match
@@ -213,27 +213,27 @@ func Test_search_cmdline2()
   call assert_equal('  2 these', getline('.'))
   1
   " go to next match (on next line)
-  call feedkeys("/the\<c-n>\<cr>", 'tx')
+  call feedkeys("/the\<C-G>\<cr>", 'tx')
   call assert_equal('  3 the theother', getline('.'))
   1
   " go to next match (still on line 3)
-  call feedkeys("/the\<c-n>\<c-n>\<cr>", 'tx')
+  call feedkeys("/the\<C-G>\<C-G>\<cr>", 'tx')
   call assert_equal('  3 the theother', getline('.'))
   1
   " go to next match (still on line 3)
-  call feedkeys("/the\<c-n>\<c-n>\<c-n>\<cr>", 'tx')
+  call feedkeys("/the\<C-G>\<C-G>\<C-G>\<cr>", 'tx')
   call assert_equal('  3 the theother', getline('.'))
   1
   " go to previous match (on line 3)
-  call feedkeys("/the\<c-n>\<c-n>\<c-n>\<c-p>\<cr>", 'tx')
+  call feedkeys("/the\<C-G>\<C-G>\<C-G>\<C-T>\<cr>", 'tx')
   call assert_equal('  3 the theother', getline('.'))
   1
   " go to previous match (on line 3)
-  call feedkeys("/the\<c-n>\<c-n>\<c-n>\<c-p>\<c-p>\<cr>", 'tx')
+  call feedkeys("/the\<C-G>\<C-G>\<C-G>\<C-T>\<C-T>\<cr>", 'tx')
   call assert_equal('  3 the theother', getline('.'))
   1
   " go to previous match (on line 2)
-  call feedkeys("/the\<c-n>\<c-n>\<c-n>\<c-p>\<c-p>\<c-p>\<cr>", 'tx')
+  call feedkeys("/the\<C-G>\<C-G>\<C-G>\<C-T>\<C-T>\<C-T>\<cr>", 'tx')
   call assert_equal('  2 these', getline('.'))
 
   " clean up