Skip to content

Commit d62bbc5

Browse files
committed
Fix issue with CtrlPLine and empty search string
When navigating to a line and selecting it (without entering a search string), vim would report "E35: No previous regular expression".
1 parent bde7a29 commit d62bbc5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

autoload/ctrlp/line.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ fu! ctrlp#line#accept(dict)
5959
let bufnr = str2nr(get(info, 1))
6060
if bufnr
6161
cal ctrlp#acceptfile(mode, bufnr, get(info, 2))
62-
let @/ = input
63-
call search(input, 'c')
64-
call histadd("search", input)
62+
if !empty(input)
63+
let @/ = input
64+
call search(input, 'c')
65+
call histadd("search", input)
66+
en
6567
en
6668
endf
6769

0 commit comments

Comments
 (0)