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

Update find-and-replace #18649

merged 1 commit into from Jan 4, 2019


None yet
1 participant
Copy link

50Wliu commented Jan 4, 2019

Requirements for Contributing a Bug Fix

Identify the Bug

See atom/find-and-replace#966, which fixes 5 issues!

find-and-replace was mistakenly assuming that any object with a buffer was also a text editor, which is usually but not always the case, leading to some nasty uncaught exceptions when using plantuml-viewer.

Description of the Change

@howyi and I worked together to craft a PR that makes sure the object is a TextEditor instead of checking for the existence of a buffer.

Alternate Designs

There were a couple of alternatives explored - accessing the buffer using getBuffer, also making sure the buffer property exists - but none of them fixed the root cause.

Possible Drawbacks

In the very unlikely event that there's some Atom package out there that implements all the methods that find-and-replace needs to perform correctly yet isn't a TextEditor, find-and-replace will no longer work with that package.

Verification Process

  1. Install plantuml-viewer (and Java)
  2. Open a plantuml viewer
  3. In the editor that belongs to it, activate find-and-replace
  4. Focus the plantuml viewer and verify that no exceptions are thrown

The test suite was also run.

Release Notes

Fixed an issue where find-and-replace would not work correctly with plantuml-viewer.

@50Wliu 50Wliu merged commit 8e12707 into master Jan 4, 2019

3 checks passed

Atom Pull Requests #20190104.4 succeeded
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@50Wliu 50Wliu deleted the wl-update-find-and-replace branch Jan 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.