mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3471: crash when using CTRL-T after an empty search pattern
Problem: Crash when using CTRL-T after an empty search pattern.
Solution: Bail out when there is no previous search pattern. (closes vim/vim#8953)
d8d957de86
This commit is contained in:
parent
88a4ac22f0
commit
649a11bc13
@ -1606,6 +1606,10 @@ static int may_do_command_line_next_incsearch(int firstc, long count, incsearch_
|
||||
|
||||
if (search_delim == ccline.cmdbuff[skiplen]) {
|
||||
pat = last_search_pattern();
|
||||
if (pat == NULL) {
|
||||
restore_last_search_pattern();
|
||||
return FAIL;
|
||||
}
|
||||
skiplen = 0;
|
||||
patlen = (int)STRLEN(pat);
|
||||
} else {
|
||||
|
@ -1527,4 +1527,14 @@ func Test_incsearch_highlighting_newline()
|
||||
bw
|
||||
endfunc
|
||||
|
||||
func Test_no_last_search_pattern()
|
||||
CheckOption incsearch
|
||||
|
||||
let @/ = ""
|
||||
set incsearch
|
||||
" this was causing a crash
|
||||
call feedkeys("//\x14", 'xt')
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Loading…
Reference in New Issue
Block a user