diff --git a/content/commands.js b/content/commands.js index 33d16682..3ae2cad3 100644 --- a/content/commands.js +++ b/content/commands.js @@ -1314,12 +1314,7 @@ vimperator.Commands = function () //{{{ var leaderRegexp = //i; if (leaderRegexp.test(lhs)) - { - var leaderRef = vimperator.variableReference("mapleader"); - var leader = leaderRef[0] ? leaderRef[0][leaderRef[1]] : "\\"; - - lhs = lhs.replace(leaderRegexp, leader); - } + lhs = lhs.replace(leaderRegexp, vimperator.events.getMapLeader()); if (rhs) { @@ -1481,6 +1476,9 @@ vimperator.Commands = function () //{{{ for (var abbrCmd in vimperator.editor.abbreviations) line += abbrCmd; + // if (vimperator.events.getMapLeader() != "\\") + // line += "\nlet mapleader = \"" + vimperator.events.getMapLeader() + "\"\n"; + // source a user .vimperatorrc file line += "\nsource! " + filename + ".local\n"; line += "\n\" vim: set ft=vimperator:"; diff --git a/content/events.js b/content/events.js index 4d7dfb4d..7b130e47 100644 --- a/content/events.js +++ b/content/events.js @@ -425,6 +425,12 @@ vimperator.Events = function () //{{{ return (key == "" || key == "" || key == ""); }, + getMapLeader: function () + { + var leaderRef = vimperator.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 a032ea29..dea67dbb 100644 --- a/content/hints.js +++ b/content/hints.js @@ -69,7 +69,7 @@ vimperator.Hints = function () //{{{ function updateStatusline() { - vimperator.statusline.updateInputBuffer((escapeNumbers ? "\\ ": "") + // sign for escapeNumbers + vimperator.statusline.updateInputBuffer((escapeNumbers ? vimperator.events.getMapLeader() + " ": "") + // sign for escapeNumbers (hintString ? "\"" + hintString + "\"" : "") + (hintNumber > 0 ? " <" + hintNumber + ">" : "")); } @@ -591,7 +591,7 @@ vimperator.Hints = function () //{{{ hintNumber = 0; break; - case "\\": + case vimperator.events.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/mappings.js b/content/mappings.js index b754b5e3..2fe4e8aa 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -1129,9 +1129,10 @@ vimperator.Mappings = function () //{{{ { shortHelp: "Start QuickHint mode", usage: ["f{hint}"], - help: "In QuickHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a unique number (FIXME: numbers shown, but not usable yet).
" + + help: "In QuickHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a unique number.
" + "You can now either type this number or type any part of the URL which you want to follow, and it is followed as soon as it can be uniquely identified. " + "Often it is can be useful to combine these techniques to narrow down results with some letters, and then typing a single digit to make the match unique.
" + + "Pressing <leader> (defaults to :let mapleader = \"\\\") toggles 'escape-mode', where numbers are treated as normal text.
" + "<Esc> stops this mode at any time." } ));