Skip to content

Fix wrong bracket match rectangle on auto format #9551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2020

Conversation

magedrifaat
Copy link
Contributor

@magedrifaat magedrifaat commented Dec 22, 2019

This commit fixes #9544
When setText is called on editorTab 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.
A more straightforward way would have been calling the function
"doBracketMatching" on textarea but the function is protected.
Actually setLineWrap is the only public function that I am able to find
that internally (eventually) calls doBracketMatching.
I am not familiar with your testing framework and couldn't find any
information about it to run the tests so I only tested the changes manually.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully ran tests with your changes

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.
@facchinm facchinm added this to the Release 1.8.11 milestone Dec 30, 2019
@cmaglie cmaglie merged commit 586e7d5 into arduino:master Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

box around } not in correct place.
3 participants