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

Impelement reload-all command #2476

Closed

Conversation

EpocSquadron
Copy link
Contributor

This is a work in progress. I'm stuck fighting the borrow checker if someone can help.

Will close #2326

) -> anyhow::Result<()> {
for doc in cx.editor.documents_mut() {
doc.selections().keys().for_each(|view_id| {
doc.reload(*view_id);
Copy link
Member

Choose a reason for hiding this comment

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

You shouldn't be calling reload() multiple times since it'll reload the file from disk on each call. Instead reload should be called with a single view (pick one at random)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reload method seems to be updating selections belonging to that view as well as history, does that not matter? I thought about refactoring the internal methods (apply, etc) to be view agnostic, but maybe they should loop through all views instead of doing it here?

@the-mikedavis the-mikedavis added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 18, 2022
@kirawi kirawi added A-helix-term Area: Helix term improvements S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 13, 2022
@EpocSquadron
Copy link
Contributor Author

Superceded by #4663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add :reload-all command to reload all changed buffers
4 participants