diff --git a/common/content/util.js b/common/content/util.js index 2b953817..158d337b 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -173,18 +173,24 @@ const util = { //{{{ * @param {string} str * @param {RegExp} marker */ - /* - * I hate this function. I hate it, I hate it. I really hate it. - * --Kris - */ splitLiteral: function splitLiteral(str, marker) { - let re = RegExp(/((?:[^\\'"]|\\(?:%)|'.*?'|".*?")*?)(%|$)/.source.replace(/%/g, marker.source), "gy"); let results = []; - let match; + let resep = RegExp(/^(([^\\'"]|\\.|'([^\\']|\\.)*'|"([^\\"]|\\.)*")*?)/.source + marker.source); + let cont = true; - while ((match = re.exec(str)) && match[0]) - results.push(match[1]); + while (cont) + { + cont = false; + str = str.replace(resep, function (match, before) + { + results.push(before); + cont = true; + return ""; + }); + } + + results.push(str); return results; }, diff --git a/vimperator/content/config.js b/vimperator/content/config.js index 813d8fc3..ea4f5df7 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -461,16 +461,12 @@ const config = { //{{{ "Change the title of the window", "string", "Vimperator", { - getter: function() { - return document.getElementById(config.mainWindowID || "main-window") - .getAttribute("titlemodifier"); - }, setter: function (value) { try { - document.getElementById(config.mainWindowID || "main-window") - .setAttribute("titlemodifier", value); + let id = config.mainWindowID || "main-window"; + document.getElementById(id).setAttribute("titlemodifier", value); if (window.content.document.title.length > 0) document.title = window.content.document.title + " - " + value; else