Syntaxt highlighting issue

I've copied the code from the opening post in Car dashboard SSD1306 read & display speed sensor and did paste it in the IDE (initially 2.3.6, later 2.3.7 nightly build 20251025).

It was first noticed that void setup() was not highlighted.

This can be solved by applying an autoformat.

The next observation was that the PROGMEM table did not always colour correctly .

In line 33 and following lines the colouring is omitted. An autoformat sometimes mostly fixes this for most lines but not the two long lines (and the line following that). Undoing an autoformat does only partially restore the original syntax highlighting; it keeps the incorrect highlighting in 34 to 36 and often in other lines.

Note that the table issue (for me) is a lowest priority issue; it's just a tiny bit annoying when it's observed :wink:
Not highlighting setup() is a bigger issue as it can indicate a non-existing mistake.

Windows 11
IDE 2.3.6 and 2.3.7 nightly build 20251025
Tests done with a non-saved sketch and a saved sketch.

Hi @sterretje. I messed a bit with the sketch you list.

While doing something on the long lines (???) I got a message, something about highlighting stopped for performance reasons on long lines. I tried to get the message up again but could not manage that.

It did mention changing the “Editor: Max Tokenization Line Length” (defaulted to 500 - the first long line is over 2200 long) to fix that. Tried and it does indeed fix it.

Thanks. I did not see that message about "something about highlighting stopped for performance reasons on long lines".

Note that we did find that exceptionally long code lines cause significant performance impact when the setting is at higher values:

So if you are going to change the setting, please make sure you remember having done that so you don't later assume any resulting poor performance is inherent to Arduino IDE.

The setting was 20000 at the time when the reports of poor performance under these conditions were received, so it might well be that you will still achieve acceptable performance even with value like 2500.

There is a request to increase the default value of the setting from the current 500 here: