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 /common/content/editor.js | |
parent | 56b7f55ef644bd75e4ec243ae55253dcc207f0ba (diff) | |
download | pentadactyl-a6e245b0bfb959d9a26cb924581f881e900f706f.tar.gz |
Add some mappings to AUTOCOMPLETE mode.
Diffstat (limited to 'common/content/editor.js')
-rw-r--r-- | common/content/editor.js | 21 |
1 files changed, 21 insertions, 0 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 () { |