mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 22:27:59 +01:00
Merge branch 'master' into xulmus
This commit is contained in:
@@ -147,13 +147,13 @@ function Buffer() //{{{
|
||||
getter: function () window.fullScreen
|
||||
});
|
||||
|
||||
options.add(["nextpattern"],
|
||||
options.add(["nextpattern"], // \u00BB is » (>> in a single char)
|
||||
"Patterns to use when guessing the 'next' page in a document sequence",
|
||||
"stringlist", "\\bnext\\b,^>$,^(>>|»)$,^(>|»),(>|»)$,\\bmore\\b");
|
||||
"stringlist", "\\bnext\\b,^>$,^(>>|\u00BB)$,^(>|\u00BB),(>|\u00BB)$,\\bmore\\b");
|
||||
|
||||
options.add(["previouspattern"],
|
||||
options.add(["previouspattern"], // \u00AB is « (<< in a single char)
|
||||
"Patterns to use when guessing the 'previous' page in a document sequence",
|
||||
"stringlist", "\\bprev|previous\\b,^<$,^(<<|«)$,^(<|«),(<|«)$");
|
||||
"stringlist", "\\bprev|previous\\b,^<$,^(<<|\u00AB)$,^(<|\u00AB),(<|\u00AB)$");
|
||||
|
||||
options.add(["pageinfo", "pa"], "Desired info on :pa[geinfo]", "charlist", "gfm",
|
||||
{
|
||||
|
||||
@@ -1298,15 +1298,8 @@ function CommandLine() //{{{
|
||||
// user pressed ENTER to carry out a command
|
||||
// user pressing ESCAPE is handled in the global onEscape
|
||||
// FIXME: <Esc> should trigger "cancel" event
|
||||
// FIXME: This should not be waiting, some kind of callback mechanism on completion would be better.
|
||||
if (events.isAcceptKey(key))
|
||||
{
|
||||
while (completions.context.incomplete)
|
||||
{
|
||||
liberator.threadYield(true);
|
||||
command = this.command;
|
||||
}
|
||||
|
||||
let mode = currentExtendedMode; // save it here, as modes.pop() resets it
|
||||
keepCommand = true;
|
||||
currentExtendedMode = null; // Don't let modes.pop trigger "cancel"
|
||||
|
||||
@@ -249,6 +249,40 @@ const util = { //{{{
|
||||
return delimiter + str.replace(/([\\'"])/g, "\\$1").replace("\n", "\\n", "g").replace("\t", "\\t", "g") + delimiter;
|
||||
},
|
||||
|
||||
/**
|
||||
* Split a string on literal occurances of a marker.
|
||||
*
|
||||
* Specifically this ignores occurences preceded by a backslash, or
|
||||
* contained within 'single' or "double" quotes.
|
||||
*
|
||||
* It assumes backslash escaping on strings, and will thus not count quotes
|
||||
* that are preceded by a backslash or within other quotes as starting or
|
||||
* ending quoted sections of the string.
|
||||
*
|
||||
* @param {string} str
|
||||
* @param {RegExp} marker
|
||||
*/
|
||||
splitLiteral: function splitLiteral(str, marker)
|
||||
{
|
||||
let results = [];
|
||||
let resep = RegExp(/^(([^\\'"]|\\.|'([^\\']|\\.)*'|"([^\\"]|\\.)*")*?)/.source + marker.source);
|
||||
let cont = true;
|
||||
|
||||
while (cont)
|
||||
{
|
||||
cont = false;
|
||||
str = str.replace(resep, function (match, before)
|
||||
{
|
||||
results.push(before);
|
||||
cont = true;
|
||||
return "";
|
||||
});
|
||||
}
|
||||
|
||||
results.push(str);
|
||||
return results;
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts <b>bytes</b> to a pretty printed data size string.
|
||||
*
|
||||
@@ -618,7 +652,7 @@ const util = { //{{{
|
||||
*/
|
||||
stringToURLArray: function stringToURLArray(str)
|
||||
{
|
||||
let urls = str.split(RegExp("\\s*" + options["urlseparator"] + "\\s*"));
|
||||
let urls = util.splitLiteral(str, RegExp("\\s*" + options["urlseparator"] + "\\s*"));
|
||||
|
||||
return urls.map(function (url) {
|
||||
try
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>3.0</em:minVersion>
|
||||
<em:maxVersion>3.2a1pre</em:maxVersion>
|
||||
<em:maxVersion>3.6a1pre</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
</Description>
|
||||
|
||||
@@ -160,7 +160,7 @@ ________________________________________________________________________________
|
||||
section:Navigating[navigating]
|
||||
|
||||
|H| |<C-o>| |CTRL-O| |:ba| |:back|
|
||||
||:[count]ba[ck] [url]|| +
|
||||
||:[count]ba[ck] [a][url][a]|| +
|
||||
||:ba[ck]!|| +
|
||||
||CTRL-o||
|
||||
________________________________________________________________________________
|
||||
@@ -171,7 +171,7 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
|L| |<C-i>| |CTRL-i| |:fo| |:fw| |:forward|
|
||||
||:[count]fo[rward] [url]|| +
|
||||
||:[count]fo[rward] [a][url][a]|| +
|
||||
||:fo[rward]!|| +
|
||||
||CTRL-i||
|
||||
________________________________________________________________________________
|
||||
|
||||
Reference in New Issue
Block a user