diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-03-04 18:32:24 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-03-04 18:41:23 +0900 |
commit | 90b83d7b7b99598834466c97e9c74c82cbd25cf3 (patch) | |
tree | f7faf5e1f1b757725ec49c8fdc7493ba3bd503e8 /src/content | |
parent | 37410b874f89de4907ba038244318129835e8157 (diff) |
hide console on <Esc> and <C-{>
Diffstat (limited to 'src/content')
-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], |