Skip to content

Incorrect error line highlight when error is inside folded code #8457

Closed
@per1234

Description

@per1234

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

  1. Create the following sketch in the Arduino IDE:
    void setup() {}
    void loop() {
      #error
    }
  2. File > Preferences > Enable Code Folding (check) > OK
  3. Click the [-] icon to the left of the line:
    void loop() {
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions