[Vimperator] uppercase test only when alpha are existent
Doug Kearns
dougkearns at gmail.com
Tue Jul 3 05:40:41 PDT 2007
G'day Marco,
On 7/3/07, calmar <mac at calmar.ws> wrote:
> Hi,
>
> I have not much knowledge about javascript. You may need to 'redo'
> it to some degree (put the check into a seperate function or
> however).
>
> It's not even worth a patch I think, so I paste it here:
>
> It checks in vimperator.js (my lines have a +) :
>
<snip>
> + if ( hasAlpha && vimperator.input.buffer.toUpperCase() == vimperator.input.buffer)
> vimperator.hints.openHints(true, false);
Just in case you're interested, JavaScript has regular expressions so
you could replace your patch with something like:
if ( /[A-Za-z]/.test(vimperator.input.buffer) &&
vimperator.input.buffer.toUpperCase() == vimperator.input.buffer)
<snip>
> if the buffer has any Alpha-Charaters in it. If not, it should not
> open a new tab (it should use false as the first argument in
> vimperator.hints.openHints(false,false)
>
> E.g. when I set hintchars=0123456789 I want *not* a 'new-tab' to
> my default, therefore the tweak above.
Right, but if I understand correctly, you lose the ability to ever
open hints in the background when hintchars is set as above.
Thanks for this patch. I'll leave it for Martin to comment on and
commit as he's currently rethinking hints.
Thanks,
Doug
More information about the Vimperator
mailing list