Closed pfn closed 1 year ago
Thanks for pointing it out, it looks quite straight-forward to me. And I reckon it wouldn't take much effort to implement a G-code colorizer. However it does not support mobile devices, OTOH the current editor doesn't either.
TBH I haven't checked how editor plugins could be loaded but since we'll start supporting plugins in v3.3, editor plugins may be feasible too.
The fluidd commit linked has a gcode colorizer already, I don't know what the source license for that is offhand and if it's compatible here.
monaco is a really huge editor. it blow up the frontend, thats why we switched to codemirror v6 in mainsail. its much lighter and it have full touch support.
here you can find more infos: https://codemirror.net/6/
@meteyou We're already using CodeMirror with a custom G-code mode in DWC but the current version isn't compatible with touch devices.
@chrishamm yes, codemirror V5 haven't touch support, but V6 works fine with ipad, iphone and android phones.
Perhaps lets change this FR to be to update codemirror to v6 or newer.
@meteyou @pfn I've created a new branch v3.4-dev-cm6 which has experimental CodeMirror 6 support and the first impression was quite good. But unfortunately I do not regard it stable yet because of a few rather serious issues:
Monaco is now part of v3.5-dev.
Hey @chrishamm -- I'm not sure how the existing file editor works but all the keybindings and everything aren't obviously documented anywhere. It would be great if we could embed something like VS Code's monaco editor and use that instead, possibly open up being able to install editor plugins so that we could have our own choice of keybindings as well?
I saw that fluidd recently embedded monaco, and I think it's something that's worth taking up for DWC.
What do you think?
References: https://microsoft.github.io/monaco-editor/ https://github.com/cadriel/fluidd/releases/tag/v1.12.1 https://github.com/cadriel/fluidd/commit/b81dec4cc21bd6b6c59b35f97237d32ac85e7b7e