1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-27 10:33:31 +01:00

hack-- for completions

This commit is contained in:
Martin Stubenschrott
2008-06-08 23:59:31 +00:00
parent ec91920bb8
commit 9b9a92e0cd
2 changed files with 11 additions and 17 deletions

View File

@@ -100,7 +100,7 @@ liberator.Mail = function () //{{{
"Unread: " + folders[folder].getNumUnread(false)]); "Unread: " + folders[folder].getNumUnread(false)]);
} }
return [0, liberator.filter(completions, filter)]; return [0, liberator.completion.filter(completions, filter)];
} }
function moveOrCopy(copy, destinationFolder, operateOnThread) function moveOrCopy(copy, destinationFolder, operateOnThread)

View File

@@ -339,20 +339,10 @@ liberator.CommandLine = function () //{{{
["<Space>"], "Expand command line abbreviation", ["<Space>"], "Expand command line abbreviation",
function () function ()
{ {
// XXX: VERY ugly, hacky code, I know, but it fixes :side<tab><space><tab> liberator.commandline.resetCompletions();
liberator.editor.expandAbbreviation("c"); return liberator.editor.expandAbbreviation("c");
var commandline = document.getElementById("liberator-commandline-command"); },
var txt = commandline.value; { flags: liberator.Mappings.flags.ALLOW_EVENT_ROUTING });
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",
@@ -748,8 +738,7 @@ liberator.CommandLine = function () //{{{
} }
else // any other key else // any other key
{ {
// reset the tab completion this.resetCompletions();
completionIndex = historyIndex = UNINITIALIZED;
} }
return true; // allow this event to be handled by Firefox return true; // allow this event to be handled by Firefox
} }
@@ -987,6 +976,11 @@ liberator.CommandLine = function () //{{{
} }
}, },
resetCompletions: function ()
{
completionIndex = historyIndex = UNINITIALIZED;
},
// it would be better if we had a destructor in javascript ... // it would be better if we had a destructor in javascript ...
destroy: function () destroy: function ()
{ {