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

avoid reloading invalid views #4889

Closed

Conversation

mangas
Copy link
Contributor

@mangas mangas commented Nov 25, 2022

Closes #4878

Copy link
Member

@dead10ck dead10ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would #4888 make this obsolete?

@mangas
Copy link
Contributor Author

mangas commented Nov 25, 2022

Would #4888 make this obsolete?

Yes and no, it would not be needed but having this effectively prevents a regression if changes are made to the close mechanism or view map assumptions.

Happy to close it if it's not needed :)

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should avoid being defensive here: by being defensive we might allow broken assumptions to cause hard-to-debug quirks

Comment on lines +1063 to +1066
.filter_map(|id| match cx.editor.tree.contains(id) {
true => Some(id),
false => None,
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think clippy is saying here that this could be filter(|id| cx.editor.tree.contains(*id)) rather than a filter_map

Copy link
Contributor Author

@mangas mangas Nov 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should avoid being defensive here: by being defensive we might allow broken assumptions to cause hard-to-debug quirks

No worries, I wasnt sure how large a fix the close stuff would be so decided to check this route as well. I'll close the PR

@mangas mangas closed this Nov 26, 2022
@mangas mangas deleted the reload-avoid-invalid-views branch November 26, 2022 01:04
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.

Panic when calling :reload-all (sometimes)
3 participants