CC: Tweaked

CC: Tweaked

42M Downloads

[edit program] Syntax highlighting for multiline comments

Commandcracker opened this issue ยท 1 comments

commented

Description
Make syntax highlighting correct for multiline comments.

Screenshot_20230401_182922

This is a common issue among editors for CC (SammyForReal/CONSULT#7)

commented

I'm kinda hoping we can reuse our new lexer for syntax highlighting in edit.

However, we don't want to have to re-concatenate the whole file for each change, so I think we probably need to make the lexer operate on a refillable buffer rather than a single string. If we add the requirement that refilling counts as a line break, we should be able to do this without much additional performance or implementation cost.

There's also a bit of work to be done on the edit side to support multi-line tokens. I suspect we'll need to support some level of incremental lexing, though hopefully can get away without doing something too complex.

I don't really have any plans to do this myself. I think it'd probably be quite a fun task, if someone wants to give it a shot.