diff --git a/content/events.js b/content/events.js index 53cc4e00..0a539eee 100644 --- a/content/events.js +++ b/content/events.js @@ -948,12 +948,6 @@ liberator.Events = function () //{{{ return (key == "" || key == "" || key == ""); }, - getMapLeader: function () - { - var leaderRef = liberator.variableReference("mapleader"); - return leaderRef[0] ? leaderRef[0][leaderRef[1]] : "\\"; - }, - // argument "event" is delibarately not used, as i don't seem to have // access to the real focus target // diff --git a/content/hints.js b/content/hints.js index b196c26c..902137e4 100644 --- a/content/hints.js +++ b/content/hints.js @@ -71,7 +71,7 @@ liberator.Hints = function () //{{{ function updateStatusline() { - liberator.statusline.updateInputBuffer((escapeNumbers ? liberator.events.getMapLeader() + " ": "") + // sign for escapeNumbers + liberator.statusline.updateInputBuffer((escapeNumbers ? liberator.mappings.getMapLeader() + " " : "") + // sign for escapeNumbers (hintString ? "\"" + hintString + "\"" : "") + (hintNumber > 0 ? " <" + hintNumber + ">" : "")); } @@ -752,7 +752,7 @@ liberator.Hints = function () //{{{ hintNumber = 0; break; - case liberator.events.getMapLeader(): + case liberator.mappings.getMapLeader(): escapeNumbers = !escapeNumbers; if (escapeNumbers && usedTabKey) // hintNumber not used normally, but someone may wants to toggle hintNumber = 0; // s ? reset. Prevent to show numbers not entered. diff --git a/content/io.js b/content/io.js index ba03cb9e..db715852 100644 --- a/content/io.js +++ b/content/io.js @@ -242,8 +242,8 @@ liberator.IO = function () //{{{ for (var abbrCmd in liberator.editor.abbreviations) line += abbrCmd; - // if (liberator.events.getMapLeader() != "\\") - // line += "\nlet mapleader = \"" + liberator.events.getMapLeader() + "\"\n"; + // if (liberator.mappings.getMapLeader() != "\\") + // line += "\nlet mapleader = \"" + liberator.mappings.getMapLeader() + "\"\n"; // source a user .vimperatorrc file line += "\nsource! " + filename + ".local\n"; @@ -458,7 +458,7 @@ liberator.IO = function () //{{{ var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); - var tmpname = liberator.config.name.toLowerCase() + "-" + + var tmpname = liberator.config.name.toLowerCase() + "-" + window.content.document.location.hostname + ".tmp"; if (liberator.config.name == "Muttator") tmpname = "mutt-ator-mail"; // to allow vim to :set ft=mail automatically diff --git a/content/mappings.js b/content/mappings.js index 5ccfdcd8..6a8ed69a 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -130,7 +130,7 @@ liberator.Mappings = function () //{{{ function expandLeader(keyString) { var leaderRegexp = //i; - var currentLeader = liberator.events.getMapLeader(); + var currentLeader = liberator.mappings.getMapLeader(); return keyString.replace(leaderRegexp, currentLeader); } @@ -345,6 +345,12 @@ liberator.Mappings = function () //{{{ return matches; }, + getMapLeader: function () + { + var leaderRef = liberator.variableReference("mapleader"); + return leaderRef[0] ? leaderRef[0][leaderRef[1]] : "\\"; + }, + // returns whether the user added a custom user map hasMap: function (mode, cmd) {