coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.46k stars 431 forks source link

[highlight] Matlab ".m" file bug #697

Open MasaakiHirai opened 7 years ago

MasaakiHirai commented 7 years ago

There is following bug on the Matlab ".m" file.

CotEditor can't recognize one single " ' " for the transposed matrix. Therefore nesting for text becomes irregular.

samschott commented 4 years ago

There may a mitigation, by replacing the character syntax recognition with a regex

'(?:[^'\n]|'')*'

which forbids new lines in a character array.

This does not prevent the false detection of the transpose operator ' as a the beginning of a char array but it does limit the damage to a single line instead of potentially the rest of the document.

1024jp commented 3 years ago

Because I recently received similar issues. I explain again the current state of this issue.


Due to the limitation of the current CotEditor's implementation to extract syntax highlighting, fixing this is hard (maybe impossible).

I know I need to re-design the entire syntax parsing algorithm, but actually, not yet planned due to my limited time resource. Sorry for that. I'll consider again if there is a way to work around it.