Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Public/css/highlight.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
color: #c0c;
}

.exp-error {
background: #d22;
.exp-syntax-error {
border-top: solid 2px #d22;
}

span.match-char {
Expand Down
2 changes: 1 addition & 1 deletion Public/js/views/expression_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class ExpressionField extends EventDispatcher {
this.highlighter.clearError();
}

tippy(".exp-error", {
tippy(".exp-syntax-error", {
allowHTML: true,
animation: false,
placement: "bottom",
Expand Down
11 changes: 7 additions & 4 deletions Public/js/views/expression_highlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,20 @@ export default class ExpressionHighlighter extends EventDispatcher {
error.location.end - error.location.start
);
const widget = document.createElement("span");
widget.className = `${pre}-error`;
widget.className = `${pre}-syntax-error`;

widget.style.height = `2px`;
widget.style.height = `5px`;
widget.style.zIndex = "10";
widget.setAttribute("data-tippy-content", error.message);
widget.setAttribute(
"data-tippy-content",
`<span class="fw-bolder text-danger">${error.behavior}:</span> ${error.message}`
);

editor.addWidget(location.startPos, widget);
const startCoords = editor.charCoords(location.startPos, "local");
const endCoords = editor.charCoords(location.endPos, "local");
widget.style.left = `${startCoords.left + 1}px`;
widget.style.top = `${startCoords.bottom}px`;
widget.style.top = `${startCoords.bottom - 1}px`;
widget.style.width = `${endCoords.left - startCoords.left - 2}px`;

this.widgets.push(widget);
Expand Down