Skip to content

vim_mode: Cannot open deletion diff hunk when it is right after the other diffs #42934

@xipeng-jin

Description

@xipeng-jin

Summary

In vim mode, you cannot use the keybind do to open the deletion diff hunk when it is right below the other diff.

Description

When using Vim mode in Zed, the keybind d o (open deletion diff hunk) fails to work when a deletion hunk (red block) is positioned immediately after an addition/modification hunk (green block) in the diff view.

In the attached screenshots (standing in for the original video), the cursor is placed on the red deletion hunk directly below a green/yellow hunk. Pressing d o correctly opens the green hunk, but pressing d o on the red hunk does nothing—the deletion diff UI does not expand, and Zed gives no feedback.

This only occurs when the deletion hunk is directly adjacent to another hunk above it. If the deletion hunk is separated, d o works normally. Here is short illustration recording

Screen.Recording.2025-11-17.at.8.06.10.PM.mov

Steps to reproduce:

  1. Enable Vim mode.
  2. Open a file with Git changes where a green/yellow diff block is immediately followed by a red deletion block (e.g., modifying some lines, then removing others directly beneath them).
  3. Move the cursor to the green/yellow block and press d o → hunk opens (works as expected).
  4. Move the cursor to the red block immediately below the green block and press d o → nothing happens.

Expected Behavior: d o should open the deletion diff hunk regardless of whether it is adjacent to another diff block.
Actual Behavior: d o does nothing when the deletion hunk is directly below another hunk. The diff hunk does not expand, and the command appears to be ignored.

Zed Version and System Specs

Zed: v0.212.6 (Zed)
OS: macOS 15.5
Memory: 16 GiB
Architecture: aarch64

If applicable, attach your Zed.log file to this issue.

Zed.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:parity/vimFeedback for Vim parity featuresstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions