mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Add option to disable blank searches #179

Closed rakeshbala closed 8 years ago

rakeshbala commented 8 years ago

This pull request adds an option to disable blank searches. Current behaviour runs blank search against the word under the cursor. Setting the 'g:ack_no_blank_search' changes this behaviour to echo an error message and return.

It also bypasses search through the ack package if the cursor is under empty string

ches commented 8 years ago

Hi @zeroGMac, thanks for cooking this up. My only feedback is that I'd like to change the option name, I think it's awkward to have a negatory option name which you set to a true value to disable a feature, if that makes senseā€¦ So it's a slightly wordy, but I'd propose g:ack_use_cword_for_empty_search as the option, with default value of 1.

Could you make that change? Nice idea to no-op if <cword> turns out to be empty, by the way.

For posterity this enhancement references #178.

ches commented 8 years ago

Please squash the rename into the first commit! šŸ˜„

rakeshbala commented 8 years ago

@ches Done.

ches commented 8 years ago

Sorry for the git gymnastics headache, but it looks like somehow an earlier commit that's already merged snuck into this branch now with a SHA changeā€”could you try to iron that out? Then we're good to go.

rakeshbala commented 8 years ago

Done

ches commented 8 years ago

Thank you!