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) {
|
if (target.nodeName !== 'SPAN' || state.hoverTimeout !== undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!target.classList.contains('cm-variable-valid')) {
|
||||||
if (target.className !== 'cm-variable-valid') {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,10 +25,11 @@ export const defineCodeMirrorBrunoVariablesMode = (variables, mode) => {
|
|||||||
stream.eat('}');
|
stream.eat('}');
|
||||||
let found = pathFoundInVariables(word, variables);
|
let found = pathFoundInVariables(word, variables);
|
||||||
if (found) {
|
if (found) {
|
||||||
return 'variable-valid';
|
return 'variable-valid random-' + (Math.random() + 1).toString(36).substring(9);
|
||||||
} else {
|
} 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;
|
word += ch;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user