patch 8.0.1304: CTRL-G/CTRL-T don't work with incsearch and empty pattern
Problem: CTRL-G/CTRL-T don't work with incsearch and empty pattern.
Solution: Use the last search pattern. (Christian Brabandt, closes #2292)
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index 2a660c6..d13e654 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -461,6 +461,15 @@
" moves to next match of previous search pattern, just like /<cr>
call feedkeys("/\<c-t>\<cr>", 'tx')
call assert_equal([0,1,7,0], getpos('.'))
+
+ " using an offset uses the last search pattern
+ call cursor(1, 1)
+ call setline(1, ['1 bbvimb', ' 2 bbvimb'])
+ let @/ = 'b'
+ call feedkeys("//e\<c-g>\<cr>", 'tx')
+ call assert_equal('1 bbvimb', getline('.'))
+ call assert_equal(4, col('.'))
+
set noincsearch
call test_override("char_avail", 0)
bw!