arduino-ide icon indicating copy to clipboard operation
arduino-ide copied to clipboard

Increase `editor.maxTokenizationLineLength` standard value to minimum 750

Open CptHolzschnauz opened this issue 2 years ago • 9 comments

Describe the problem

Sketch with a long line leads to strange behaviour in the IDE.

  • Wrong color parsing after col +/- 500

In a long line of code, after character +/- 500 the IDE stops coloring: Bildschirmfoto 2022-11-02 um 06 17 32

In some cases, following lines are also not highlighted: Bildschirmfoto 2022-11-02 um 06 25 32

To reproduce

Put that sketch snippet in the IDE, around col 500 the effect starts:

void setup() {
  String mqtt_msg = "('" + mqtt_device_id + "','" + String(longitude_tft, 10) + "','" + String(latitude_tft, 10) + "','" + mqtt_alarm + "','" + String(B1Volt, 1) + "','" + String(B2Volt, 1) + "','" + Batt_Temp11 + "','" + Batt_Temp12 + "','" + Batt_Temp13 + "','" + Batt_Temp14 + "','" + Batt_Temp15 + "','" + Batt_Temp16 + "','" + Batt_Temp21 + "','" + Batt_Temp22 + "','" + Batt_Temp23 + "','" + Batt_Temp24 + "','" + Batt_Temp25 + "','" + Batt_Temp26 + "','" + Batt_Temp31 + "','" + Batt_Temp32 + "','" + Batt_Temp33 + "','" + Batt_Temp34 + "','" + Batt_Temp35 + "','" + Batt_Temp36 + "','" + Batt_Temp41 + "','" + Batt_Temp42 + "','" + Batt_Temp43 + "','" + Batt_Temp44 + "','" + Batt_Temp45 + "','" + Batt_Temp46 + "','" + String(air_quality_score) + "','" + mqtt_status1 + "','" + mqtt_status2 + "','" + mqtt_status3 + "','" + mqtt_status4 + "','" + (t - 3) + "','" + h + "','" + (p / 100) + "','" + SIV + "','" + cog + "','" + sog + "')";
}
void loop() {}

Expected behavior

  • Correct color parsing for sketches that contain reasonably long lines

Arduino IDE version

2.0.1

Operating system

macOS

Operating system version

12

Issue checklist

  • [X] I searched for previous reports in the issue tracker
  • [X] I verified the problem still occurs when using the latest nightly build
  • [X] My report contains all necessary details

CptHolzschnauz avatar Nov 02 '22 05:11 CptHolzschnauz