diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-02-17 22:23:51 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-02-17 22:23:51 -0500 |
commit | a6e245b0bfb959d9a26cb924581f881e900f706f (patch) | |
tree | 3794551b4210419d8d43cd4abf3f01a46ed42008 | |
parent | 56b7f55ef644bd75e4ec243ae55253dcc207f0ba (diff) | |
download | pentadactyl-a6e245b0bfb959d9a26cb924581f881e900f706f.tar.gz |
Add some mappings to AUTOCOMPLETE mode.
-rw-r--r-- | common/content/editor.js | 21 | ||||
-rw-r--r-- | 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(["<Esc>"], "Return to INSERT mode", + function () Events.PASS); + + bind(["<Up>"], "Select the next autocompletion result", + function () Events.PASS); + + bind(["<Down>"], "Select the next autocompletion result", + function () Events.PASS); + + bind(["<C-[>"], "Return to INSERT mode", + function () { events.feedkeys("<Esc>", { skipmap: true }); }); + + bind(["<C-n>"], "Select the next autocompletion result", + function () { events.feedkeys("<Down>", { skipmap: true }); }); + + bind(["<C-p>"], "Select the next previous result", + function () { events.feedkeys("<Up>", { 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. |