Skip to content

Commit fdb9201

Browse files
committed
Ensure line is unfolded when highlighting for error
Fixes arduino#8457 For some reason, getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(line) doesn't work here; there no documentation on what offset is. Also, getFoldForLine(line) returns null even if the line is folded (bug in rsyntaxtextarea?)
1 parent 3ba8583 commit fdb9201

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/src/processing/app/Editor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,6 +1648,13 @@ public void removeAllLineHighlights() {
16481648
}
16491649

16501650
public void addLineHighlight(int line) throws BadLocationException {
1651+
if (getCurrentTab().getTextArea().getFoldManager().isLineHidden(line)) {
1652+
for (int i = 0; i < getCurrentTab().getTextArea().getFoldManager().getFoldCount(); i++) {
1653+
if (getCurrentTab().getTextArea().getFoldManager().getFold(i).containsLine(line)) {
1654+
getCurrentTab().getTextArea().getFoldManager().getFold(i).setCollapsed(false);
1655+
}
1656+
}
1657+
}
16511658
getCurrentTab().getTextArea().addLineHighlight(line, new Color(1, 0, 0, 0.2f));
16521659
getCurrentTab().getTextArea().setCaretPosition(getCurrentTab().getTextArea().getLineStartOffset(line));
16531660
}

0 commit comments

Comments
 (0)