Currently, I'm not able to compile any Zig code containing line breaks (just try with the default square function), getting this compiler error: <source>:2:33: error: invalid carriage return, only '\n' line endings are supported.
see also https://ziglang.org/documentation/master/#Source-Encoding
CC @tiehuis - any ideas?
On Windows it appears Monaco gives back lines with carriage returns when asking for text from the buffer by default since we don't explicitly specify what we want.
Adding a request explicitly for newline only data from the editor should fix this, presumably at this point here. See api documentation for getValue.
Changing like this would be shared across all languages however, would this behavior be valid? Is there any reason to keep the status quo for any languages?
From @RabsRincon (who is offline but replied in slack):
this.editor.getModel().setEOL(monaco.editor.EndOfLineSequence.LF);
plus a bit of logic should do the trick on the editor
Ey! Sorry this took so long. I have forced a LF EOL in the editor which seems to fix the problem and not cause other languages to fail, so the fix should be pushed with the next site update :)
I missreferenced the issue in the commit message, but e326384 closes this
Most helpful comment
Ey! Sorry this took so long. I have forced a LF EOL in the editor which seems to fix the problem and not cause other languages to fail, so the fix should be pushed with the next site update :)
I missreferenced the issue in the commit message, but e326384 closes this