Handle buffers' files changing on disk from outside of Zed - #54
Merged
Conversation
maxbrunsfeld
force-pushed
the
file-changed-on-disk
branch
from
May 11, 2021 22:44
fd697c5 to
3fa03c4
Compare
maxbrunsfeld
force-pushed
the
file-changed-on-disk
branch
from
May 11, 2021 23:18
3fa03c4 to
040189d
Compare
Collaborator
Author
|
@nathansobo @as-cii One thing that's currently incomplete in this PR is deciding when we should populate/update the |
...as we're supposed to call this method only via ViewContext.
Member
as-cii
force-pushed
the
file-changed-on-disk
branch
from
May 12, 2021 13:21
265052e to
048bbc9
Compare
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Anthony-Eid
added a commit
to Anthony-Eid/zed
that referenced
this pull request
Oct 27, 2024
* Begin integrating languages with DAP * Add dap status type to activity indicator Co-authored-by: Remco Smits <djsmits12@gmail.com> * Show dap status to users * Change Status enum to use ServerStatus struct in activity indicator --------- Co-authored-by: Remco Smits <djsmits12@gmail.com>
ShalashaskaOcelot
pushed a commit
to ShalashaskaOcelot/zed
that referenced
this pull request
Jul 30, 2026
Two user-reported defects: workspace: saving to a path outside the project showed "Failed to save: no such worktree" even though the bytes reached disk, and left the item still titled "Untitled" and detached from its file (bug zed-industries#47). Phase 53 made such a save create an INVISIBLE worktree, which the worktree store holds only weakly, and Pane::save_item's strong handle lived inside the `if let` block — so it dropped before save_task.await and destroyed the worktree mid-save. The notebook's save_as writes the file and only then opens a buffer, so open_buffer failed and the `?` skipped the code that records the new path. Hold the worktree until the save completes. repl: clicking the sidebar's kernel selector aborted the app with a GPUI double-lease panic (bug zed-industries#54) — the click listener held a lease and toggled the picker inline, whose on_open updates the same notebook. Defer the toggle via window.defer, matching the existing fix for the run-with-no-kernel path, and give launch_kernel's show the same treatment. Also fixes a clippy lint in the bug zed-industries#50 regression test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUB73REGigaN5TCgvSkM2s
ShalashaskaOcelot
pushed a commit
to ShalashaskaOcelot/zed
that referenced
this pull request
Jul 30, 2026
…tebooks (bug zed-industries#56) A notebook opened or saved outside the project lives in a single-file worktree whose abs_path() is the FILE, not a directory. The kernel was spawned with that path as its working directory, which Windows rejects with ERROR_DIRECTORY ("The directory name is invalid", os error 267) — so no interpreter could start for such a notebook. Use the file's parent directory when the worktree is a single file; directory worktrees are unchanged. Also archives phases 53/55/57 and bugs zed-industries#47/zed-industries#54 as user-confirmed, ticks the confirmed phase 48 items, and files bug zed-industries#59 (external notebooks not restored across a restart). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUB73REGigaN5TCgvSkM2s
ShalashaskaOcelot
pushed a commit
to ShalashaskaOcelot/zed
that referenced
this pull request
Aug 6, 2026
Audited every CHANGELOG claim against the code: all phase and bug entries are genuinely implemented (symbol checks for each), and every commit hash inside this shallow clone's history resolves to the work it claims. Nothing needed pulling out for review. Fixes found along the way: - Bugs zed-industries#47 and zed-industries#54 were archived as user-confirmed by c199237 but that commit never deleted their bugs.md entries, so both were double-tracked. Removed. - Bug zed-industries#63 was still "open — needs a decision" although phase 59 implemented the decided behaviour. Moved to fix attempted - untested with the fix recorded. - Bugs zed-industries#7, zed-industries#15 and zed-industries#20 sat at fix attempted - untested with no pointer in the testing ledger, so they were invisible there. Added with test recipes. - Bug zed-industries#56's changelog hash was a transposition (c199273 → c199237). Phases 59 and 60 are implementation-complete with only manual tests left, so their test items move to awaiting_testing.md and the phase files are recorded in the changelog and deleted. Six phases remain in rotation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUB73REGigaN5TCgvSkM2s
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…-on-disk Handle buffers' files changing on disk from outside of Zed
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.
Fixes #52
FileHandle::observe_from_model. Before, this callback would only be called when a file was moved or deleted. Now, we store anmtimeon eachFileHandleso that content changes are also reported.Buffer::set_text_via_diffmethod that takes a string of new text, computes a corresponding diff in a background thread, and applies that diff to the buffer.has_conflictmethod toWorkspace::Itemtrait. Use that method to give special visual treatment to buffers that have in-memory changes and on-disk changes since they were loaded. Right now, we show a red dot for these files, instead of a blue dot.