The Wayback Machine - https://web.archive.org/web/20221207070035/https://github.com/atom/bracket-matcher/pull/212
Skip to content
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

Make updating matches faster for multi-cursor editing #212

Merged
merged 2 commits into from Feb 19, 2016

Conversation

as-cii
Copy link
Contributor

@as-cii as-cii commented Feb 16, 2016

With this PR we make use of the new TextBuffer.prototype.onDidChangeText API and we also avoid to update bracket matches when the cursor moves because of a text change, because that scenario is already handled by the onDidChangeText event.

Before

screen shot 2016-02-16 at 10 28 29

(Total: ~ 240ms, benchmark performed by editing 500 lines, inserting 5 characters)

After

screen shot 2016-02-16 at 10 28 03

(Total: ~ 4ms, 60x faster)

/cc: @nathansobo @maxbrunsfeld

as-cii added 2 commits Feb 16, 2016
Also, avoid updating the bracket matcher when the
cursor moves because of a text change. That
scenario is already handled by the
`onDidChangeText` event.
@maxbrunsfeld
Copy link
Contributor

maxbrunsfeld commented Feb 16, 2016

Awesome!

as-cii added a commit that referenced this pull request Feb 19, 2016
Make updating matches faster for multi-cursor editing
@as-cii as-cii merged commit c09872b into master Feb 19, 2016
@as-cii as-cii deleted the as-use-new-buffer-apis branch Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants