Skip to content

cherry-pick: Backport v1.9-v1.10 bug fixes - #1

Merged
liusuren123 merged 12 commits into
custom-for-cn-userfrom
cherry-pick/bug-fixes-1
Jul 2, 2026
Merged

cherry-pick: Backport v1.9-v1.10 bug fixes#1
liusuren123 merged 12 commits into
custom-for-cn-userfrom
cherry-pick/bug-fixes-1

Conversation

@liusuren123

Copy link
Copy Markdown
Owner

Summary

从上游 v1.9.0 / v1.10.0-pre cherry-pick 了 12 个 bug fix 提交,无需汉化改动。

Picked commits

Commit PR Description
bf6022a6 zed-industries#59384 Fix opening folders whose name ends in (number)
7cbb1af9 zed-industries#59449 Fix gg and ge motions in Helix mode
986f33f3 zed-industries#55459 Fix Vim out-of-scope insert line above
084672c9 zed-industries#59470 Fix gpui web examples build
42f549da zed-industries#59657 Fix copilot sign-in window floating above all apps
5b796003 zed-industries#59155 Fix Git panel selection hidden after commit
f1544c6ca zed-industries#57405 Fix completion with text selection
dfada8cd zed-industries#59480 Fix Python docstring formatting in hover
32d8245d zed-industries#59758 Fix Python completion item highlighting
0729bbc3 zed-industries#53680 Fix Go Debug Test for subtests
54682ca8 zed-industries#55672 Fix binary name resolution against PATH on macOS
8b575c58 zed-industries#59728 Fix Skill tool Configure button routing

Skipped (incompatible with current Cargo deps or gpui API)

Build status

cargo check passed locally (targets: languages, settings_ui, gpui, audio, editor, vim)

Release Notes:

  • N/A

sijokun and others added 12 commits July 3, 2026 00:32
…ndustries#59384)

## Objective

Dragging a folder onto the Zed dock icon (or otherwise opening it by
path) failed
when the folder's name ended in a parenthesized number, e.g. `Test (1)`
or `Test (2,3)`. Instead of opening the folder, Zed opened a
  non-existent, truncated path (`Test `), so nothing useful appeared.

The cause is `PathWithPosition::parse_str`, which supports MSVC-style
position
suffixes like `file.c(22)` → file `file.c`, row `22`. A folder named
`Test (1)`
was therefore parsed as path `Test ` at row `1`.
`derive_paths_with_position` has
a guard that restores the literal path when it exists on disk — but it
only
checked `fs.is_file(...)`, so directories never qualified and the
truncated path
  was used.

  ## Solution

In `derive_paths_with_position`, restore the original path when it
points to an
existing file **or directory** (`fs.is_file(...) || fs.is_dir(...)`),
instead of
  files only.

  ## Testing

- Added
`test_derive_paths_with_position_directory_with_position_like_name`,
which
opens `Test (1)`, `Project (2,3)`, and `test project` directories and
    asserts the full paths survive with no row/column.
- Added `test_parse_str_treats_paren_suffix_as_position` in `util`
documenting the
    underlying `parse_str` behavior that necessitates the guard.
- Manually verified on macOS: built a debug `Zed Dev.app`, dropped
folders named
    `Test (1)` onto the dock icon — it now open correctly;
    previously a non-existent folder was opened.

  ## Self-Review Checklist:

  - [x] I've reviewed my own diff for quality, security, and reliability
  - [x] Unsafe blocks (if any) have justifying comments — N/A, no unsafe
  - [ ] The content adheres to Zed's UI standards — N/A, no UI change
  - [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable — one
extra `is_dir`
stat only when a path parses to a row and differs from the original

  ---

  Release Notes:

- Fixed folders whose names end in a parenthesized number (e.g. `Test
(1)`) failing to open from the dock or by path

(cherry picked from commit 362035d)
# Objective

- This PR fixed the `gg` and `ge` motion in Helix mode to match the
behavoir from Helix. Fixes zed-industries#56702

## Solution

- The solution is to add custom handling for the StartOfDocument and
EndOfDocument Motions in normal and select mode. For both cases, column
0 is hard coded in the DisplayPoint for the destination of the motion.

## Testing

- Did you test these changes? If so, how?
Yes, I added unit tests which pass and also manually tested the `gg` and
`ge` motions in the new build.
- Are there any parts that need more testing?
- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
1. Enable Helix mode in the settings
2. Open a file with multiple lines
3. Move to the middle of the file
4. Press `gg` and `ge`
5. Cursor should move to start or end of file at column 0
6. Same for Select mode

- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
I only tested on Linux (Fedora). Since the changes are not platform
specific, I don't think more testing is necessary, but always welcome.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed `gg` and `ge` motions to jump to the first character on the line
and match Helix exactly.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
(cherry picked from commit ef38a41)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#52588

Release Notes:

- Fixed insert line above out of an scope

Co-authored-by: Yara 🏳️‍⚧️ <git@yara.blue>
(cherry picked from commit 50b4a1c)
fix `cargo xtask web-examples --no-serve` error.

Building GPUI web examples for wasm failed because gpui's ordinary
dev-dependencies were included in the wasm build graph. That pulled in
proptest's default fork/timeout support, which depends on wait-timeout.
wait-timeout does not support wasm32-unknown-unknown, so compilation
failed.

The a11y example also had a wasm_bindgen start function but was missing
the wasm no_main crate attribute, so Rust still expected a normal main
function and emitted E0601.

Move gpui's proptest dev-dependency behind the non-wasm target so web
example builds do not include native-only test timeout support. Add the
wasm no_main crate attribute to the a11y example.

Verified with:

```
cargo tree --target wasm32-unknown-unknown -p gpui -i wait-timeout
cargo xtask web-examples --no-serve
```

---

Release Notes:

- N/A or Added/Fixed/Improved ...

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
(cherry picked from commit 9a992ed)
…ndustries#59657)

The Copilot code verification window was opened with
`WindowKind::PopUp`,
which causes the window to float above all other applications.
Changed to `WindowKind::Normal` so it stays scoped to Zed.

Fixes zed-industries#51043

Release Notes:

- Fixed Copilot sign-in window floating above all other applications
instead of being scoped to Zed

(cherry picked from commit 7b73d5c)
(cherry picked from commit a9d6e2a850839912f2911270c41b877edcede8b8)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Issue:
- Create and/or modify several files.
- Go to GitPanel.
- Stage files you want to commit.
- Select last entry. You may select not last but make sure after list of
entries shrinks, your selection would be "out of visible list" after.
- Commit.
- Entries will be committed and disappear.
- But it seems like `selected_entry` is not updated (or updated
incorrectly) and Zed still have "hidden" selected entry of the last
selected entry. So you need to `Shift-g` (in vim mode) or some other
keybinding to select last entry manually. I used `k` multiple times
before I realized I can use `Shift-g` or `g g` -,-

Release Notes:

- Fixed: stale index (`selected_entry`) of git panel after .

Notes:
- I basically copied logic of function 1 line above but instead of
`first_entry` I used `last_etnry`. So... It should be harmless.
- I didn't find where selection logic is tested. I tried to do something
using `test_amend` as template, but... I'm afraid I won't be able to
understand if I'm using testing framework correctly.
- I couldn't make tests, but I tried to "test" by hand using something
like this:
<img width="358" height="487" alt="image"
src="https://github.com/user-attachments/assets/8575bdcc-f59b-44f2-99e3-fe663e5e61f1"
/>

Flat View seems like working fine, but Tree View has some "bugs" (if we
can call it like that) inherited. For example, if I stage selected file
and commit it, selection jumps to the `asdjfl` instead of the file right
under - `outer_file`. The same behavior in the current release.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
(cherry picked from commit 13dd39b)
(cherry picked from commit 53e63069b5b97538da9ed50a47d1358d4194f45c)
…he selection (zed-industries#57405)

Fix the completion list not showing the current selection when you
execute `editor: show completions`, the stated reason by comment before
is that if you are in a tabstop snippet already it wont give you the
correct options. So my change is to just check if you are in such a
snippet and if not give the new desired behavior.

before:

https://github.com/user-attachments/assets/1b2f3594-7361-4636-9ef3-f8c9419faa26

after:

https://github.com/user-attachments/assets/1be35582-464a-40f3-b6be-ee74f9961796

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#57386

Release Notes:

- editor: include text from selection in completion list.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
(cherry picked from commit e990f31)
…ries#59480)

# Objective

Fixes zed-industries#59426

Python (and possible others like JS/TS ) docstrings in hover popovers
currently have broken indentation and alignment. This happens because
markdown soft breaks (single newlines) are parsed and replaced with
spaces by default. This collapses multi-line Python docstrings into
single wraps, ruining code example layouts and line-wrapped formatting.

## Solution

Configure the `MarkdownStyle` returned by `hover_markdown_style` in
`crates/editor/src/hover_popover.rs` to treat soft breaks as hard breaks
(`soft_break_as_hard_break: true`). This ensures single newlines in
docstrings are preserved and rendered correctly in the hover popover.

## Testing

- Verified hover popovers locally on Python methods/classes to confirm
that multi-line docstring indentation and alignment are preserved.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Fixed Python and Markdown docstring formatting/alignment in hover
popovers.

---------

Co-authored-by: Martin Ye <martin@zed.dev>
(cherry picked from commit 91ff38a)
(cherry picked from commit b3f3be4ab2bb8518f483f6cbb21277c18b26fee1)
…s#59758)

# Objective

Consider a simple Python file with the following content, where both a
method and a function are defined:
```python
class TestCase:
    def a_test_method(self):    # a method
        print("This is a method test")

def a_test_function():    # a function
    print("This is a function test")
```

Below this, if we type `a_test_func` and trigger language server
completion, we would expect to see `a_test_function` in the completion
list. Similarly, if we have:
```python
test = TestCase()
test.a_testˇ
```
and trigger language server completion, we should see `a_test_method` in
the completion list.

In both cases, we expect the items in the completion list to have the
same color highlighting as they do in the editor buffer, but currently,
they do not. This is because Zed uses the wrong queries to retrieve the
highlight. Taking the `ty` LSP adapter as an example:

https://github.com/zed-industries/zed/blob/d753a31db53e40c47cfb59964102f07c5493eb4f/crates/languages/src/python.rs#L323-L332
the key `"function.method"` and `"function"` are used to look up the
method and function highlight IDs, but these keys do not exist in
`crates/grammars/src/python/highlights.scm`, which defines the syntax
highlighting. The correct keys here should be `"function.method.call"`
and `"function.call"`.

## Solution

- As stated above, change the keys from `"function.method"` and
`"function"` to `"function.method.call"` and `"function.call"`,
respectively.
- Additionally, since we have several built-in language servers for
Python, a minor refactoring has been done to reduce duplicate code and
simplify future changes.

## Testing

- I have tested this change locally; the before and after comparison is
provided below.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

<details>
  <summary>Click to view showcase</summary>

| Before | After |
| :---: | :---: |
| <img width="767" height="308" alt="function_before"
src="https://github.com/user-attachments/assets/943852d6-f54e-411d-916f-add7aac57956"
/> | <img width="767" height="308" alt="function_after"
src="https://github.com/user-attachments/assets/3a817229-ce32-4d13-88b8-9e9151869338"
/> |
| <img width="767" height="308" alt="method_before"
src="https://github.com/user-attachments/assets/cbc0f4f4-be6e-44d3-9798-df29df5731a3"
/> | <img width="767" height="308" alt="method_after"
src="https://github.com/user-attachments/assets/6e8f7e84-c5c6-4b37-a2c5-10820f12a09d"
/> |

</details>

---

Release Notes:

- Improved Python completion item highlighting for methods and
functions.

(cherry picked from commit f5c1912)
(cherry picked from commit 7bf3fa9b41cfd84c0e012daac816a8fbd5b5e85d)
The `go-subtest` task template wrapped the `-run` arg in single quotes
for shell safety. This works for Run Test (terminal strips quotes), but
Debug Test sends the arg through Delve’s DAP protocol with no shell
involved, so the literal quote characters ended up in the regex and
prevented any match.

All other Go task templates (`go-test`, `go-testify-suite`,
`go-table-test-case`) use the backslash-escaped format which `GoLocator`
already knows how to handle. Align the `go-subtest` template to the same
format.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#53230.

Release Notes:

- Fixed Debug Test for Go subtests

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
(cherry picked from commit 438070b)
(cherry picked from commit 0729bbc323af9baacfeafc58e397ebb4db0364f2)
…es#55672)

Closes zed-industries#50536

Addresses zed-industries#50536

- On macOS, `posix_spawnp` resolves programs against the parent
process's `cwd` and `environ` (via `getcwd` and `getenv("PATH")`),
ignoring the child's `current_dir` and `envp`. This causes two classes
of failures when Zed spawns external commands via the custom
`posix_spawnp`-based `Command`:
- **Bare names** (e.g. `"black"`): resolved via the parent's `PATH`, not
the child's — binaries only available in a project-specific PATH
(Nix/direnv) are not found.
- **Relative paths** (e.g. `"./script.sh"`, `"bin/test.sh"`): resolved
against the parent's `cwd`, not `current_dir` — only works when Zed's
cwd happens to match the project root.
- Added program resolution in `spawn_posix_spawn`
(`crates/util/src/command/darwin.rs`): before calling `posix_spawnp`,
resolve the program to an absolute path — bare names via
`which::which_in` against the child's PATH, relative paths via
`Path::join(current_dir)`. Falls back to the original program if
resolution fails.

Apple's Libc implementation of `posix_spawnp` resolves the program path
using the parent process's context — `getcwd()` for relative paths and
`getenv("PATH")` for bare names — rather than the `current_dir` (set via
`posix_spawn_file_actions_addchdir_np`) or `envp` argument. The child's
working directory and environment only take effect **after** the binary
has already been located. This is a well-documented macOS behavior that
Rust's own `std::process::Command` works around by bypassing
`posix_spawn` when PATH is modified (see
[rust-lang/rust#48624](rust-lang/rust#48624)).

The regression was introduced when PR zed-industries#49090 switched macOS from
`std::process::Command` (which uses fork+execvp, correctly using the
child's cwd and PATH) to a custom posix_spawnp-based implementation
(which does not).

- `test_bare_program_resolved_via_custom_path` — bare name resolves via
child's custom PATH
- `test_bare_program_with_custom_path_falls_back_when_not_found` —
non-existent binary still errors
- `test_bare_program_with_custom_env_no_path_key` — custom env without
PATH key falls back gracefully
- `test_relative_path_skips_resolution` — relative path resolves against
`current_dir` instead of parent's cwd

Note: The fix and tests are in `darwin.rs` which is macOS-only. The
Linux path uses `smol::process::Command` (via fork+execve) and is
unaffected.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed external formatters and language servers failing to launch on
macOS when specified as a bare binary name or relative path and only
available in the project's PATH (e.g. Nix, direnv)

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
(cherry picked from commit d1f500e)
(cherry picked from commit 867d9be3a331ab533192a48f3a3274402040223b)
…-industries#59728)

The Skill page now renders the correct “Skill Tool” title, the
skill-specific explanation, and reads/writes the `skill` tool’s own
rules.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

## Showcase

| Before | After |
|--------|--------|
| <img width="956" height="816" alt="image"
src="https://github.com/user-attachments/assets/e88ef051-aa5c-46de-9843-e3400fd63a7f"
/> | <img width="956" height="816" alt="image"
src="https://github.com/user-attachments/assets/77b8223d-bd97-4ac2-901d-15cf368341ec"
/> |

Closes zed-industries#59720.

---

Release Notes:

- Fixed the Skill tool’s “Configure” button in the Agent’s Tool
Permissions settings opening the Terminal tool’s configuration instead
of the Skill tool’s own permission rules

(cherry picked from commit daf4656)
(cherry picked from commit 45ae09b922a31bf6a026f8840ab0c18217a820a8)
@liusuren123
liusuren123 merged commit efdb143 into custom-for-cn-user Jul 2, 2026
21 checks passed
@liusuren123
liusuren123 deleted the cherry-pick/bug-fixes-1 branch July 2, 2026 16:57
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.