mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 15:57:57 +01:00
Implement http://vimperator.org/trac/ticket/92 (restore ;F) (revert if want)
The implementation provides the same functionality as ;F while still maintaining the Vimp2.0 style hints. There is definitely room for refactoring here.
This commit is contained in:
@@ -73,6 +73,7 @@ function Hints() //{{{
|
|||||||
t: Mode("Follow hint in a new tab", function (elem) buffer.followLink(elem, liberator.NEW_TAB)),
|
t: Mode("Follow hint in a new tab", function (elem) buffer.followLink(elem, liberator.NEW_TAB)),
|
||||||
b: Mode("Follow hint in a background tab", function (elem) buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB)),
|
b: Mode("Follow hint in a background tab", function (elem) buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB)),
|
||||||
w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, liberator.NEW_WINDOW), extended),
|
w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, liberator.NEW_WINDOW), extended),
|
||||||
|
F: Mode("Follow hint sequence in tabs", hintSequenceElement),
|
||||||
O: Mode("Preselect hint in an :open query", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)),
|
O: Mode("Preselect hint in an :open query", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)),
|
||||||
T: Mode("Preselect hint in a :tabopen query", function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)),
|
T: Mode("Preselect hint in a :tabopen query", function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)),
|
||||||
W: Mode("Preselect hint in a :winopen query", function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)),
|
W: Mode("Preselect hint in a :winopen query", function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)),
|
||||||
@@ -82,6 +83,21 @@ function Hints() //{{{
|
|||||||
Y: Mode("Yank hint description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended)
|
Y: Mode("Yank hint description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Implement ';F' hint sequences. This function handles on element of the hint sequence.
|
||||||
|
function hintSequenceElement(elem)
|
||||||
|
{
|
||||||
|
// Want to always open sequence hints in background
|
||||||
|
// (remember: NEW_BACKGROUND_TAB and NEW_TAB semantics assume
|
||||||
|
// that loadInBackground=true)
|
||||||
|
if( options.getPref("browser.tabs.loadInBackground") )
|
||||||
|
buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB);
|
||||||
|
else
|
||||||
|
buffer.followLink(elem, liberator.NEW_TAB);
|
||||||
|
|
||||||
|
// Move to next element in sequence
|
||||||
|
hints.show("F");
|
||||||
|
}
|
||||||
|
|
||||||
// reset all important variables
|
// reset all important variables
|
||||||
function reset()
|
function reset()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ this hint mode. Then press [a]24[a] to copy the hint location.
|
|||||||
* |;t| [m]t[m] to open its location in a new tab
|
* |;t| [m]t[m] to open its location in a new tab
|
||||||
* |;b| [m]b[m] to open its location in a new background tab
|
* |;b| [m]b[m] to open its location in a new background tab
|
||||||
* |;w| [m]w[m] to open its destination in a new window
|
* |;w| [m]w[m] to open its destination in a new window
|
||||||
|
* |;F| [m]F[m] to follow a sequence of [m]<CR>[m]-delimited hints in background tabs
|
||||||
* |;O| [m]O[m] to preselect its location in an [c]:open[c] query
|
* |;O| [m]O[m] to preselect its location in an [c]:open[c] query
|
||||||
* |;T| [m]T[m] to preselect its location in a [c]:tabopen[c] query
|
* |;T| [m]T[m] to preselect its location in a [c]:tabopen[c] query
|
||||||
* |;W| [m]W[m] to preselect its location in a [c]:winopen[c] query
|
* |;W| [m]W[m] to preselect its location in a [c]:winopen[c] query
|
||||||
|
|||||||
Reference in New Issue
Block a user