Branches (1061)

main (default)

2cad6c8 svg_preview: Detect SVG in single-file mode by checking file name (#45747)

Click to expand commit body
Release Notes:

- Use the files name for "is svg" checks so SVG previews and the toolbar
button work in single-file mode.

Gabe Shahbazian created

v0.218.x

d4541ec Fix Zed OOM-ing when macOS file descriptors become invalid (#45669) (cherry-pick to preview) (#45700)

Click to expand commit body
Cherry-pick of #45669 to preview

----
Closes https://github.com/zed-industries/zed/issues/42845

Repro steps:

https://github.com/zed-industries/zed/issues/42845#issuecomment-3687413958
Initial investigation and Zed memory trace:

https://github.com/zed-industries/zed/issues/42845#issuecomment-3687877977

The PR consists of 2 commits:
*

[first](https://github.com/zed-industries/zed/pull/45669/changes/732d308c8d7e9af3649ac71ea65a9c029af820fc)
adds cosmetic fixes to remove backtraces from logs yet again and print
paths in quotes, as file descriptors may return empty paths.
It also stubs the cause if OOM in project panel: that one traversed all
worktrees in `for worktree_snapshot in visible_worktrees` and "accepted"
the one with empty paths + never called `entry_iter.advance();` in "no
file name found for the worktree" case, thus looping endlessly and
bloating the memory quite fast.

*

[second](https://github.com/zed-industries/zed/pull/45669/changes/7ebfe5da2fc6d32f3fa2d71c761f8b2ec26d945b)
adds something that resembles a fix: `fn current_path` on macOS used the
file handler to re-fetch the worktree root file path on worktree root
canonicalization failure.
What's odd, is that `libc::fcntl` returns `0` in the case when external
volume is not mounted, thus resulting in the `""` path string that is
propagated all the way up.

*

[third](https://github.com/zed-industries/zed/pull/45669/changes/1a7560cef3e9fac604124c19f46b1f9c7b91815f)
moves the fix down to the platform-related FS implementations

The "fix" now checks the only usage of this method inside `async fn
process_events` for an empty path and bails if that is the case.
I am not sure what is a better fix, but this stops any memory leaks and
given how bad the situation now, seems ok to merge for now with the
`TODO` comment for more clever people to fix properly later.

----------------

Now, when I disconnect the SMB share and reconnect it again, Zed stops
displaying any files in the project tree but the ones opened as editors.

As before, at first, when the share is unmounted, Zed fails to save any
changes because of the timeouts.

Later, when the share is re-connected, macOS Finder hangs still but Zed
starts to react on saves yet still only shows the files that are open as
editors.
The files can be edited and saved from now on.

Later, when Finder finally stops hanging and indicates that the share is
mounted fully, the rest of the file structure reappear in the project
panel, and all file saves are propagated, hence can be observed in the
share in Finder.

It feels that one good improvement to add on top is some "disconnected"
indicator that clearly shows that the file is not properly handles in
the OS.
This requires much more changes and thinking as nothing like that exists
in Zed yet, hence not done.

Release Notes:

- Fixed Zed OOM-ing when macOS file descriptors become invalid

Co-authored-by: Kirill Bulatov <kirill@zed.dev>

zed-zippy[bot] and Kirill Bulatov created

side-by-side-diff-without-filtering

8da8d16 Merge remote-tracking branch 'origin/main' into side-by-side-diff-without-filtering

Cole Miller created

ex-bazel-generated

cb692bf Add pre-generated files for Bazel builds

Click to expand commit body
These files are generated by build.rs scripts:
- gpui: dispatch_sys.rs, shaders.metallib
- media: bindings.rs
- proto: zed.messages.rs

Used by ex2 Bazel build to avoid running build scripts.

Nathan Sobo created

mention-crease-component

de053fa Add some tiny spacing adjustments

Danilo Leal created

ex

c8b363f gpui: Expose ShapedLine::width() for pen advancement

Nathan Sobo created

tracing-action

bf87da7 Add dev::StartTracing action to launch Tracy profiler

Click to expand commit body
- Add is_enabled() function to ztracing crate to detect if tracy support is compiled in
- Add StartTracing action that launches tracy-profiler if found on PATH
- Show appropriate notifications for success/failure states
- Show warning with icon when running debug build (profiling results won't be accurate)
- Simplify ztracing to use just --features tracy instead of requiring ZTRACING env var

Richard Feldman created

devcontainer_setup_modal

c0ebb40 First pass at the modal for setting up devcontainer from scratch.

KyleBarton created

ep-example-scoring

2ff34e5 Omit events from other worktrees from captured examples

Max Brunsfeld created

42137-add-selection-soft-wrap

ac61f26 fix(editor): use buffer columns when adding selections

Click to expand commit body
When adding selections above/below with `skip_soft_wrap: true`, use buffer
column positions instead of pixel positions. This ensures selections are
placed at the same column offset in the buffer rather than at the same
visual position, which was incorrect for soft-wrapped lines.

For example, selecting "how" in a wrapped line:

````
1. Very long line to
   show [how] a wrapped
   line would look
2. Very long line to
   show how a wrapped
   line would look
````

Now correctly adds a selection at the same buffer column in the next
line:

````
1. Very long line to
   show [how] a wrapped
   line would look
2. Very long line to
   show [how] a wrapped
   line would look
````

dino created

ex-pointer-capture

d49a8e0 Add pointer capture API for stable drag handling

Click to expand commit body
Add minimal pointer capture API to gpui::Window:
- capture_pointer(hitbox_id): starts capture for the given hitbox
- release_pointer(): releases capture
- captured_hitbox(): returns the captured hitbox, if any

When captured, HitboxId::is_hovered() returns true for the captured
hitbox regardless of actual hit testing. Capture is automatically
released on MouseUpEvent.

This enables drag operations (like scrollbar thumb dragging) to
continue working even when the pointer moves outside the element's
bounds during the drag.

Nathan Sobo created

fix_devcontainer_node_dependency

bb3e3d0 Remove implicit dependency on node env for data_dir devcontainer cli

KyleBarton created

nathan

73381f0 Merge branch 'fix-terminal-viewport-culling-rebased' into nathan

Nathan Sobo created

read-file-content-windows

1ac35fb agent: add byte-window read_file mode

Nathan Sobo created