fixup for CodeMirror failing on keyMap=""

This should not happen *normally* but a user may edit chrome.storage manually etc.
This commit is contained in:
tophf 2017-04-10 14:13:51 +03:00
parent 7084dd1223
commit 5a61ac2f18

View File

@ -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',