From a6e245b0bfb959d9a26cb924581f881e900f706f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 17 Feb 2011 22:23:51 -0500 Subject: [PATCH] Add some mappings to AUTOCOMPLETE mode. --- common/content/editor.js | 21 +++++++++++++++++++++ common/content/events.js | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index 60b36e40..71279b0e 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -839,6 +839,27 @@ var Editor = Module("editor", { modes.pop(modes.TEXT_EDIT); }, { count: true }); + + function bind() mappings.add.apply(mappings, + [[modes.AUTOCOMPLETE]].concat(Array.slice(arguments))) + + bind([""], "Return to INSERT mode", + function () Events.PASS); + + bind([""], "Select the next autocompletion result", + function () Events.PASS); + + bind([""], "Select the next autocompletion result", + function () Events.PASS); + + bind([""], "Return to INSERT mode", + function () { events.feedkeys("", { skipmap: true }); }); + + bind([""], "Select the next autocompletion result", + function () { events.feedkeys("", { skipmap: true }); }); + + bind([""], "Select the next previous result", + function () { events.feedkeys("", { skipmap: true }); }); }, options: function () { diff --git a/common/content/events.js b/common/content/events.js index c59a0ab8..156b4190 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -894,9 +894,9 @@ var Events = Module("events", { // For more information, see: // [*] Referenced mailing list msg: http://www.mozdev.org/pipermail/pentadactyl/2008-May/001548.html // [*] Mozilla bug 416227: event.charCode in keypress handler has unexpected values on Mac for Ctrl with chars in "[ ] _ \" - // https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=416227 + // https://bugzilla.mozilla.org/show_bug.cgi?id=416227 // [*] Mozilla bug 432951: Ctrl+'foo' doesn't seem same charCode as Meta+'foo' on Cocoa - // https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=432951 + // https://bugzilla.mozilla.org/show_bug.cgi?id=432951 // --- // // The following fixes are only activated if util.OS.isMacOSX.