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

Ignore untitled editors when deleting folders #1201

Merged
merged 2 commits into from Nov 11, 2017

Conversation

Projects
None yet
1 participant
@50Wliu
Member

50Wliu commented Nov 11, 2017

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

When deleting folders, we loop over all open text editors and remove all that are within the folder-to-be-deleted that are not modified. To do that, we simply compare paths. However, Untitled editors have undefined paths and I forgot to account for that before comparing the path. This PR adds an existence check to prevent an error being thrown when Untitled editors are present.

The code is now more-or-less identical to the corresponding onWillMoveEntry callback, which did have the existence check (and I believe was added afterwards).

Alternate Designs

None.

Benefits

Trying to delete a folder while having an Untitled editor open will no longer throw an error.

Possible Drawbacks

None.

Applicable Issues

Fixes atom/atom#16147

50Wliu added some commits Nov 11, 2017

@50Wliu

This comment has been minimized.

Show comment
Hide comment
@50Wliu

50Wliu Nov 11, 2017

Member

Appveyor crashes are unrelated.

Member

50Wliu commented Nov 11, 2017

Appveyor crashes are unrelated.

@50Wliu 50Wliu merged commit 302d45f into master Nov 11, 2017

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@50Wliu 50Wliu deleted the wl-untitled-editor-check branch Nov 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment