register colorpicker command on first use

This commit is contained in:
tophf 2017-11-22 05:15:52 +03:00
parent 64cb128b06
commit 612b21c732

View File

@ -49,6 +49,7 @@ window.initColorpicker = () => {
} }
function registerHotkey(id, hotkey) { function registerHotkey(id, hotkey) {
CodeMirror.commands.colorpicker = invokeColorpicker;
const extraKeys = CodeMirror.defaults.extraKeys; const extraKeys = CodeMirror.defaults.extraKeys;
for (const key in extraKeys) { for (const key in extraKeys) {
if (extraKeys[key] === 'colorpicker') { if (extraKeys[key] === 'colorpicker') {