mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
Online editor: clear errors
This commit is contained in:
parent
1f50e8c85e
commit
c9d60d3575
2 changed files with 4 additions and 7 deletions
|
@ -7,15 +7,10 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<p>This is a prototype for an online editor for the SixtyFPS language. More info <a
|
||||
href="https://github.com/sixtyfpsui/sixtyfps">github.com/sixtyfpsui/sixtyfps</a> </p>
|
||||
<div id="preview" style="max-width: 48%; float: right"></div>
|
||||
<div id="editor" style="height:600px; width: 48%"></div>
|
||||
|
||||
<table style="height: 100%">
|
||||
<tr>
|
||||
<td width="50%"></td>
|
||||
<td></td>
|
||||
</td>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -508,11 +508,13 @@ function render_or_error(source, div) {
|
|||
canvas.width = 800;
|
||||
canvas.height = 600;
|
||||
canvas.id = canvas_id;
|
||||
div.innerHTML = "";
|
||||
div.appendChild(canvas);
|
||||
try {
|
||||
sixtyfps.instantiate_from_string(source, canvas_id);
|
||||
} catch (e) {
|
||||
if (e.message === "Using exceptions for control flow, don't mind me. This isn't actually an error!") {
|
||||
monaco.editor.setModelMarkers(editor.getModel(), "sixtyfps", []);
|
||||
throw e;
|
||||
}
|
||||
var text = document.createTextNode(e.message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue