Fix discard not reloading buffer from disk#48936
Merged
SomeoneToIgnore merged 5 commits intozed-industries:mainfrom Feb 13, 2026
Merged
Conversation
…ot reloading buffer from disk
Contributor
crates/workspace/src/pane.rs
Outdated
|
|
||
| let path_style = project.read_with(cx, |project, cx| project.path_style(cx)); | ||
| if save_intent == SaveIntent::Skip { | ||
| let can_save = cx.update(|_window, cx| item.can_save(cx))?; |
Contributor
There was a problem hiding this comment.
This logic seems to be wrong?
can_savereturnstruefor a multi buffer:zed/crates/editor/src/items.rs
Lines 847 to 854 in 44015e0
- MutliBuffer's reload will reload all its contents:
zed/crates/editor/src/items.rs
Lines 934 to 958 in 44015e0
We do not want to reload from FS files that were not involved into the discard dialogue, do we?
Sounds like we need a multi buffer test for this and a bit more convoluted logic for a fix?
…discard-retains-unsaved-edits
3d1705c to
7cb87bd
Compare
…d reload to singleton buffers only
SomeoneToIgnore
approved these changes
Feb 13, 2026
Contributor
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
I would expect multi buffer to discard the related changes too, but sure we can start off this — ready to merge it after CI is green.
Contributor
Author
|
@SomeoneToIgnore I'll try to work on the multibuffer case, but from what I can tell, it needs some heavier changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48308.
Before:

After:

Release Notes: