diff options
Diffstat (limited to 'src/content/actions/setting.js')
-rw-r--r-- | src/content/actions/setting.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/content/actions/setting.js b/src/content/actions/setting.js index 0238c71..4c1e385 100644 --- a/src/content/actions/setting.js +++ b/src/content/actions/setting.js @@ -1,10 +1,17 @@ import actions from 'content/actions'; import * as keyUtils from 'shared/utils/keys'; +import operations from 'shared/operations'; + +const reservedKeymaps = { + '<Esc>': { type: operations.CANCEL }, + '<C-[>': { type: operations.CANCEL }, +}; const set = (value) => { let entries = []; if (value.keymaps) { - entries = Object.entries(value.keymaps).map((entry) => { + let keymaps = Object.assign({}, value.keymaps, reservedKeymaps); + entries = Object.entries(keymaps).map((entry) => { return [ keyUtils.fromMapKeys(entry[0]), entry[1], |