Closed
Description
Using Arduino IDE 1.8.9 Hourly Build 2019/01/24 07:33 and Arduino IDE 1.9.0-beta build 100 with Windows 10 64 bit
- Create the following sketch in the Arduino IDE:
void setup() {} void loop() { #error }
- File > Preferences > Enable Code Folding (check) > OK
- Click the [-] icon to the left of the line:
void loop() {
- Sketch > Verify/Compile
The first line of the sketch will be highlighted in pink, incorrectly indicating the error is there.
Suggested improvements on this behavior:
- Unfold the code section with the error and place the highlight on the correct line.
- Don't do an error highlight when it cannot be correctly placed. The user can always get the line number from the error message in the console.
- Place error highlight at the start of the fold. This is still slightly confusing, but it's more intuitive than the current behavior.
- Unfold all on error. This seems like it could be annoying to the user so it might just be trading a new issue for an old one.
I have a suspicion this is a limitation of rSyntaxTextArea rather than the Arduino IDE, but I'm not certain of it, so I thought it was worth reporting here.
Originally reported: http://forum.arduino.cc/index.php?topic=443558.msg4036044#msg4036044