mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-11 16:38:19 +01:00
Merge pull request #256 from brahma-dev/main
Ensure that adjacent variables are rendered in separate spans.
This commit is contained in:
commit
3c4ef2f2df
@ -66,8 +66,7 @@ if (!SERVER_RENDERED) {
|
||||
if (target.nodeName !== 'SPAN' || state.hoverTimeout !== undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.className !== 'cm-variable-valid') {
|
||||
if (!target.classList.contains('cm-variable-valid')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,11 @@ export const defineCodeMirrorBrunoVariablesMode = (variables, mode) => {
|
||||
stream.eat('}');
|
||||
let found = pathFoundInVariables(word, variables);
|
||||
if (found) {
|
||||
return 'variable-valid';
|
||||
return 'variable-valid random-' + (Math.random() + 1).toString(36).substring(9);
|
||||
} else {
|
||||
return 'variable-invalid';
|
||||
return 'variable-invalid random-' + (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