forked from extern/bruno
Add a randomly generated classname to each variable so that CodeMirror does not merge adjacent variables into the same SPAN.
This commit is contained in:
parent
a02d2b9c58
commit
0b83fbb7ce
@ -25,10 +25,11 @@ export const defineCodeMirrorBrunoVariablesMode = (variables, mode) => {
|
||||
stream.eat('}');
|
||||
let found = pathFoundInVariables(word, variables);
|
||||
if (found) {
|
||||
return 'variable-valid';
|
||||
return 'variable-valid ' + (Math.random() + 1).toString(36).substring(9);
|
||||
} else {
|
||||
return 'variable-invalid';
|
||||
return 'variable-invalid ' + (Math.random() + 1).toString(36).substring(9);
|
||||
}
|
||||
// Random classname added so adjacent variables are not rendered in the same SPAN by CodeMirror.
|
||||
}
|
||||
word += ch;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user