CC-Tweaked icon indicating copy to clipboard operation
CC-Tweaked copied to clipboard

[edit program] Syntax highlighting for multiline comments

Open Commandcracker opened this issue 1 year ago • 1 comments

Description Make syntax highlighting correct for multiline comments.

Screenshot_20230401_182922

This is a common issue among editors for CC (https://github.com/1Turtle/CONSULT/issues/7)

Commandcracker avatar Apr 01 '23 16:04 Commandcracker

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.

SquidDev avatar Apr 01 '23 19:04 SquidDev