Skip to content

Commit c478f79

Browse files
committed
Merge pull request #78 from losingkeys/prevent-empty-searches
Prevent empty searches
2 parents 1b6526a + 5ba5f94 commit c478f79

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

autoload/ag.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ function! ag#Ag(cmd, args)
8888
let l:grepargs = a:args . join(a:000, ' ')
8989
end
9090

91+
if empty(l:grepargs)
92+
echo "Usage: ':Ag {pattern}' (or just :Ag to search for the word under the cursor). See ':help :Ag' for more information."
93+
return
94+
endif
95+
9196
" Format, used to manage column jump
9297
if a:cmd =~# '-g$'
9398
let s:ag_format_backup=g:ag_format

0 commit comments

Comments
 (0)