mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:17:59 +01:00
Revert "Fix #258: :set urlseparator= results in infinite loop"
This reverts commit e0f50f4eef07670f5c4ece8496785f6683236dc8.
This commit is contained in:
@@ -173,18 +173,24 @@ const util = { //{{{
|
|||||||
* @param {string} str
|
* @param {string} str
|
||||||
* @param {RegExp} marker
|
* @param {RegExp} marker
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
* I hate this function. I hate it, I hate it. I really hate it.
|
|
||||||
* --Kris
|
|
||||||
*/
|
|
||||||
splitLiteral: function splitLiteral(str, marker)
|
splitLiteral: function splitLiteral(str, marker)
|
||||||
{
|
{
|
||||||
let re = RegExp(/((?:[^\\'"]|\\(?:%)|'.*?'|".*?")*?)(%|$)/.source.replace(/%/g, marker.source), "gy");
|
|
||||||
let results = [];
|
let results = [];
|
||||||
let match;
|
let resep = RegExp(/^(([^\\'"]|\\.|'([^\\']|\\.)*'|"([^\\"]|\\.)*")*?)/.source + marker.source);
|
||||||
|
let cont = true;
|
||||||
|
|
||||||
while ((match = re.exec(str)) && match[0])
|
while (cont)
|
||||||
results.push(match[1]);
|
{
|
||||||
|
cont = false;
|
||||||
|
str = str.replace(resep, function (match, before)
|
||||||
|
{
|
||||||
|
results.push(before);
|
||||||
|
cont = true;
|
||||||
|
return "";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
results.push(str);
|
||||||
return results;
|
return results;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -461,16 +461,12 @@ const config = { //{{{
|
|||||||
"Change the title of the window",
|
"Change the title of the window",
|
||||||
"string", "Vimperator",
|
"string", "Vimperator",
|
||||||
{
|
{
|
||||||
getter: function() {
|
|
||||||
return document.getElementById(config.mainWindowID || "main-window")
|
|
||||||
.getAttribute("titlemodifier");
|
|
||||||
},
|
|
||||||
setter: function (value)
|
setter: function (value)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
document.getElementById(config.mainWindowID || "main-window")
|
let id = config.mainWindowID || "main-window";
|
||||||
.setAttribute("titlemodifier", value);
|
document.getElementById(id).setAttribute("titlemodifier", value);
|
||||||
if (window.content.document.title.length > 0)
|
if (window.content.document.title.length > 0)
|
||||||
document.title = window.content.document.title + " - " + value;
|
document.title = window.content.document.title + " - " + value;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user