From c0fd71dda60ac9bc2682204d33e03d2eab4d7d49 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 13 Oct 2019 20:59:50 +0300 Subject: [PATCH] only recalc applies-to css on live-update if style targets the editor --- edit/applies-to-line-widget.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/edit/applies-to-line-widget.js b/edit/applies-to-line-widget.js index 9c192203..f3d227cc 100644 --- a/edit/applies-to-line-widget.js +++ b/edit/applies-to-line-widget.js @@ -173,6 +173,10 @@ function createAppliesToLineWidget(cm) { } function onRuntimeMessage(msg) { + if (msg.reason === 'editPreview' && !$(`#stylus-${msg.style.id}`)) { + // no style element with this id means the style doesn't apply to the editor URL + return; + } if (msg.style || msg.styles || msg.prefs && 'disableAll' in msg.prefs || msg.method === 'styleDeleted') {