From 5a61ac2f1831f5619d4fd362e3f6488e90a4905d Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 10 Apr 2017 14:13:51 +0300 Subject: [PATCH] fixup for CodeMirror failing on keyMap="" This should not happen *normally* but a user may edit chrome.storage manually etc. --- edit.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/edit.js b/edit.js index 9587df87..447fe943 100644 --- a/edit.js +++ b/edit.js @@ -131,6 +131,11 @@ function initCodeMirror() { var CM = CodeMirror; var isWindowsOS = navigator.appVersion.indexOf("Windows") > 0; + // CodeMirror miserably fails on keyMap="" so let's ensure it's not + if (!prefs.get('editor.keyMap')) { + prefs.reset('editor.keyMap'); + } + // default option values Object.assign(CM.defaults, { mode: 'css',