mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 13:52:26 +01:00
VERY hacky fix to allow :side<tab><space><tab> completion
This commit is contained in:
@@ -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;
|
var win = document.commandDispatcher.focusedWindow;
|
||||||
if (win && win.document.designMode == "on" && !liberator.config.isComposeWindow)
|
if (win && win.document.designMode == "on" && !liberator.config.isComposeWindow)
|
||||||
|
|||||||
@@ -337,8 +337,22 @@ liberator.CommandLine = function () //{{{
|
|||||||
|
|
||||||
liberator.mappings.add(modes,
|
liberator.mappings.add(modes,
|
||||||
["<Space>"], "Expand command line abbreviation",
|
["<Space>"], "Expand command line abbreviation",
|
||||||
function () { return liberator.editor.expandAbbreviation("c"); },
|
function ()
|
||||||
{ flags: liberator.Mappings.flags.ALLOW_EVENT_ROUTING });
|
{
|
||||||
|
// 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,
|
liberator.mappings.add(modes,
|
||||||
["<C-]>", "<C-5>"], "Expand command line abbreviation",
|
["<C-]>", "<C-5>"], "Expand command line abbreviation",
|
||||||
|
|||||||
Reference in New Issue
Block a user