Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix wrong bracket match rectangle on auto format
This commit fixes instances when setText is called on editorTab and the rectangle that highlights the bracket match becomes incorrect.
This is because text is inserted to the document without notifying the textarea.
Calling setLineWrap internally fires an event that recalculates the bracket match rectangle and thus solves the problem.
  • Loading branch information
magedrifaat authored Dec 22, 2019
commit 20ed5a209c7e37be76356a1c2004f166d76f4f0c
3 changes: 3 additions & 0 deletions app/src/processing/app/EditorTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ public void setText(String what) {
} finally {
caret.setUpdatePolicy(policy);
}
// A trick to force textarea to recalculate the bracket matching rectangle.
// In the worst case scenario, this should be ineffective.
textarea.setLineWrap(textarea.getLineWrap());
}

/**
Expand Down