From 260cbddae00356905b45942969bdbe064c95009d Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 29 Nov 2017 13:27:55 +0300 Subject: [PATCH] usercss: force-refresh codemirror on saving to repaint vars --- edit/source-editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/edit/source-editor.js b/edit/source-editor.js index 1c31a0c5..4f6ee180 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -215,6 +215,7 @@ function createSourceEditor(style) { sourceCode: cm.getValue(), })) .then(replaceStyle) + .then(() => cm.setOption('mode', cm.doc.mode)) .catch(err => { if (err.message === t('styleMissingMeta', 'name')) { messageBox.confirm(t('usercssReplaceTemplateConfirmation')).then(ok => ok &&