1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 10:08:00 +01:00

VERY hacky fix to allow :side<tab><space><tab> completion

This commit is contained in:
Martin Stubenschrott
2008-06-06 14:47:24 +00:00
parent d3552663d2
commit f735f772e4
2 changed files with 17 additions and 3 deletions

View File

@@ -1102,7 +1102,7 @@ liberator.Events = function () //{{{
}
}
var stop = true; // set to false if we should NOT consume this event but let also firefox handle it
var stop = true; // set to false if we should NOT consume this event but let Firefox handle it
var win = document.commandDispatcher.focusedWindow;
if (win && win.document.designMode == "on" && !liberator.config.isComposeWindow)

View File

@@ -337,8 +337,22 @@ liberator.CommandLine = function () //{{{
liberator.mappings.add(modes,
["<Space>"], "Expand command line abbreviation",
function () { return liberator.editor.expandAbbreviation("c"); },
{ flags: liberator.Mappings.flags.ALLOW_EVENT_ROUTING });
function ()
{
// XXX: VERY ugly, hacky code, I know, but it fixes :side<tab><space><tab>
liberator.editor.expandAbbreviation("c");
var commandline = document.getElementById("liberator-commandline-command");
var txt = commandline.value;
var start = commandline.selectionStart;
commandline.value = txt.substr(0, start) + " " +
txt.substr(commandline.selectionEnd);
commandline.selectionStart = commandline.selectionEnd = start + 1;
var evt = window.document.createEvent("KeyEvents");
var view = window.document.defaultView;
evt.initKeyEvent("keypress", true, true, view, false, false, false, false, 0, 32);
liberator.commandline.onEvent(evt);
});
liberator.mappings.add(modes,
["<C-]>", "<C-5>"], "Expand command line abbreviation",