G-code Syntax Highlighting in Text Edit Windows
-
Oh I see, I guess that is a server side application which would require the highlighting to be implemented on the DWC end. I have not used ftp on the Duet before, just tried but have not been able to DL or UL files. Not done any troubleshooting yet.
Jan
-
@snoozer You'll need to ensure the FTP client is set to only use a single concurrent connection.
-
Ah, I interperated your question as you were looking for a replacement for Atom in ms windows. Some highlighting in the web editor would be a nice feature.
-
@snimax said in G-code Syntax Highlighting in Text Edit Windows:
Ah, I interperated your question as you were looking for a replacement for Atom in ms windows. Some highlighting in the web editor would be a nice feature.
This is for chrishamm to answer; however, implementing syntax highlighting is I think much harder in HTML/CSS/javascript than it is in a normal program or an app.
-
I am unable to put or get files with FTP. I can log in but put and get fails with the "PORT failed" error. Usually a sign that the client needs to use passive mode or NAT is an issue yet I am in the same subnet without firewall. I am sure its off topic just here now, I have a look through the forum what I find.
Jan
-
@dc42 a quick google for in browser syntax highlighting brought up a few promising options.
-
@snoozer said in G-code Syntax Highlighting in Text Edit Windows:
I am unable to put or get files with FTP. I can log in but put and get fails with the "PORT failed" error. Usually a sign that the client needs to use passive mode or NAT is an issue yet I am in the same subnet without firewall. I am sure its off topic just here now, I have a look through the forum what I find.
Jan
The FTP server in RRF only supports one connection. If your FTP client defaults to opening 2 connections, reconfigure it to use just one.
-
@phaedrux said in G-code Syntax Highlighting in Text Edit Windows:
@dc42 a quick google for in browser syntax highlighting brought up a few promising options.
Just found the same thing. It does have GCode listed as supported language and there also exists Vue Prism Editor to integrate it into the new UI based on Vue.
-
I just created a pull request..
https://github.com/chrishamm/DuetWebControl/pull/226Based on PrismJS. The only one I could find that reliably highlights gcode. Also is pretty lightweight.
Needs some testing though and I also propose a UI setting to turn it on/off, but I don't have the means to translate it to all the supported languages.
Doesn't do much besides syntax highlighting based on file extensions, but at least to me it's already a great help to have comments greyed out and commands/params highlighted..
If there's a full tree of (maintained) RRF gcodes acailable then maybe CodeMirror could be an option for a more polished WebIDE.
I also think a slight rework of the FileEditor would be helpful (custom Route instead of the Dialog so a page refresh or the back button doesn't break the Dialog), but that's a topic for another day..
If there's interest I'm open to do some slight refactoring of that feature to make it work.
-
@bberger Awesome!!