diff --git a/content/events.js b/content/events.js index 5c69b011..30edae8e 100644 --- a/content/events.js +++ b/content/events.js @@ -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) diff --git a/content/ui.js b/content/ui.js index 8fcfcab5..e0c56aad 100644 --- a/content/ui.js +++ b/content/ui.js @@ -337,8 +337,22 @@ liberator.CommandLine = function () //{{{ liberator.mappings.add(modes, [""], "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 + 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, ["", ""], "Expand command line abbreviation",