rking / ag.vim

Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack'
1.74k stars 131 forks source link

Prevent empty searches #78

Closed losingkeys closed 9 years ago

losingkeys commented 9 years ago

Previously :Ag (with nothing under the cursor; e.g. an empty buffer) would open the quickfix window with "ERR: What do you want to search for?", which wasn't as helpful, and it left a useless quickfix window open.

Closes #51

ches commented 9 years ago

This seems reasonable to me. Two comments:

  1. echoerr seems appropriate here.
  2. It'd be nice if there was some hint that an empty argument is supported, but the cursor must be on a word. But of course the message should be kept as terse as possible—do you think it'd be understandable enough if the first sentence was Usage: ':Ag {pattern | <cword>}'.?
losingkeys commented 9 years ago

I'd probably change it to "cursor" or "word under cursor" or something. <cword> is a vim idiom, and people that haven't done much vim dev might not get it.

losingkeys commented 9 years ago

Thanks for the review!