ADDED: Request: DAT Python Syntax Highlighting

It’s possible I’ve missed other requests for this, other than this one from 2013, but I’m wondering if it’d be possible to get basic Python syntax highlighting in DATs, or when editing a DAT in textport.

An external editor has drawbacks, such as jumping between programs on an already busy desktop and weird temporary filenames if you’re not syncing the DAT to a file. My use case is that I have a ton of little scripts like this, and not a lot of long extensions (for which I’d use an external editor anyway).

While I do appreciate that comments are already grayed out (so long as # is the 1st character of a line), imagine how luxurious this would be.
..

pls dont judge my code

3 Likes

Yes please!

2 Likes

+1

Color. Is. Life.

2 Likes
for each in infinity:
  +1

In all seriousness though, even if full color coding is not feasible, would be nice if the bug where comments are not greyed out unless the # is the first symbol in a line could be fixed. :slight_smile:

2 Likes

Something like this?

It’s still an experiment, but we’ve been looking into it as part of the new Text COMP system we demo’d a little while ago.

9 Likes

oh wow @robmc that looks very promising indeed, sweet !

This already looks promising. The cherry on the cake would be if variables are also distinguished from functions :slight_smile:

yeah, functions vs variables is something I’d like to look at further … at the moment the parser is pretty simple to keep it fast so it’s just highlighting things like comments, string, numbers, and language keywords

woa! yes please :slight_smile: this is great.

I believe this can be marked as resolved but not sure which version took care of it.