1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 15:22:26 +01:00

new 'followhints' option, thanks Ruud

This commit is contained in:
Martin Stubenschrott
2008-11-20 20:36:25 +00:00
parent cd2c0d6c6d
commit ebdac3be1f
6 changed files with 34 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ Inactive/former developers:
* Marco Candrian (mac@calmar.ws) * Marco Candrian (mac@calmar.ws)
Patches (in no special order): Patches (in no special order):
* Ruud Grosmann ('followhints' option)
* Xie&Tian (multibyte support for hints) * Xie&Tian (multibyte support for hints)
* Juergen Descher * Juergen Descher
* Kazuo (count support for ctrl-^) * Kazuo (count support for ctrl-^)

1
NEWS
View File

@@ -16,6 +16,7 @@
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and * IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
VimperatorLeave respectively VimperatorLeave respectively
* new 'followhints' option
* :buffers supports a filter now to only list buffers matching filter (vim * :buffers supports a filter now to only list buffers matching filter (vim
incompatible, but consistent with other commands) incompatible, but consistent with other commands)
* Favicon support in many places * Favicon support in many places

View File

@@ -686,7 +686,7 @@ function History() //{{{
function (args, special) { history.list(args.string, special); }, function (args, special) { history.list(args.string, special); },
{ {
bang: true, bang: true,
completer: function (filter) completion.history(filter) // completer: function (filter) completion.history(filter)
}); });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}

View File

@@ -1035,8 +1035,6 @@ function Completion() //{{{
highlightGroup: function highlightGroup(filter) commands.get("highlight").completer(filter), // XXX highlightGroup: function highlightGroup(filter) commands.get("highlight").completer(filter), // XXX
history: function _history(filter) [0, history.get(filter)],
get javascriptCompleter() javascript, get javascriptCompleter() javascript,
javascript: function _javascript(str) javascript: function _javascript(str)

View File

@@ -323,6 +323,17 @@ function Hints() //{{{
return false; return false;
} }
if (options["followhints"] > 0)
{
if (!followFirst)
return false; // no return hit; don't examine uniqueness
// OK. return hit. But there's more than one hint. And
// there's no tab-selected current link. Do not follow in mode 2
if ((options["followhints"] == 2) && validHints.length > 1 && !hintNumber)
return liberator.beep();
}
if (!followFirst) if (!followFirst)
{ {
var firstHref = validHints[0].getAttribute("href") || null; var firstHref = validHints[0].getAttribute("href") || null;
@@ -544,6 +555,11 @@ function Hints() //{{{
"number", 0, "number", 0,
{ validator: function (value) value >= 0 }); { validator: function (value) value >= 0 });
options.add(["followhints", "fh"],
"Change the way when to automatically follow hints",
"number", 0,
{ validator: function (value) value >= 0 && value < 3 });
options.add(["linkfgcolor", "lfc"], options.add(["linkfgcolor", "lfc"],
"Foreground color of a link during hint mode", "Foreground color of a link during hint mode",
"string", "black"); "string", "black");

View File

@@ -357,6 +357,21 @@ Change the hint matching algorithm during hint mode. Possible values:
____ ____
|\'fh'| |\'followhints'|
||'followhints' 'fh'|| number (default: 0)
____
Change the function of hitting [m]<Return>[m] in hint mode. Possible values:
`---------`----------------------------------------------------------------------------------------------------------------------------------------------------------
*0* Default behavior. Link is followed as soon as text uniquely identifies it. Pressing [m]<Return>[m] follows the tab selected hint (if any) or the first link.
*1* Like 0, but don't follow link automatically if text has uniquely identified it.
*2* Like 1, but don't follow first link if there are more than 1 possibilities.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
____
|\'ht'| |\'hinttags'| |\'ht'| |\'hinttags'|
||'hinttags' 'ht'|| string ||'hinttags' 'ht'|| string
____ ____