diff options
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 () { |