check doc type for string/comment to be more mode-agnostic

This commit is contained in:
tophf 2019-09-24 13:44:13 +03:00
parent c94d9dca94
commit 85de9cedad

View File

@ -501,7 +501,7 @@ function createAppliesToLineWidget(cm) {
const docCur = cm.getSearchCursor('@-moz-document', posStart);
while (docCur.findNext() &&
CodeMirror.cmpPos(docCur.pos.to, posEnd) <= 0) {
if (!/\bdef\b/.test(cm.getTokenTypeAt(docCur.pos.from))) continue;
if (/\b(string|comment)\b/.test(cm.getTokenTypeAt(docCur.pos.from))) continue;
const applies = [];
pos = docCur.pos.to;
do {