From 80a8611377813272a1414245afe6c6e1270b7938 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Mon, 3 Mar 2008 01:08:14 +0000 Subject: [PATCH] fixed slow regression --- content/events.js | 2 +- content/ui.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/content/events.js b/content/events.js index 2e421808..04b45343 100644 --- a/content/events.js +++ b/content/events.js @@ -1290,7 +1290,7 @@ vimperator.Events = function () //{{{ if (vimperator.mode == vimperator.modes.COMMAND_LINE) { if (!(vimperator.modes.extended & vimperator.modes.INPUT_MULTILINE)) - vimperator.commandline.onEvent(event); // reroute event in command line mode + stop = !vimperator.commandline.onEvent(event); // reroute event in command line mode } else if (vimperator.mode != vimperator.modes.INSERT) vimperator.beep(); diff --git a/content/ui.js b/content/ui.js index f81e5a49..08f1fb69 100644 --- a/content/ui.js +++ b/content/ui.js @@ -514,7 +514,7 @@ vimperator.CommandLine = function () //{{{ else if (event.type == "keypress") { if (!currentExtendedMode) - return; + return true; var key = vimperator.events.toString(event); //vimperator.log("command line handling key: " + key + "\n"); @@ -561,7 +561,7 @@ vimperator.CommandLine = function () //{{{ { setCommand(historyStart); vimperator.triggerCallback("change", currentExtendedMode, this.getCommand()); - return; + break; } // cannot go past history start/end @@ -571,7 +571,7 @@ vimperator.CommandLine = function () //{{{ vimperator.beep(); break; } - if (historyIndex >= lines.length + 1) + else if (historyIndex >= lines.length + 1) { historyIndex = lines.length; vimperator.beep(); @@ -582,7 +582,7 @@ vimperator.CommandLine = function () //{{{ { setCommand(lines[historyIndex]); vimperator.triggerCallback("change", currentExtendedMode, this.getCommand()); - return; + break; } } } @@ -624,10 +624,8 @@ vimperator.CommandLine = function () //{{{ if (completions.length == 0) { vimperator.beep(); - // prevent tab from moving to the next field - event.preventDefault(); - event.stopPropagation(); - return; + // prevent tab from moving to the next field: + return false; } var wim = vimperator.options["wildmode"].split(/,/); @@ -722,6 +720,7 @@ vimperator.CommandLine = function () //{{{ // reset the tab completion completionIndex = historyIndex = UNINITIALIZED; } + return true; // allow this event to be handled by Firefox } },