zed
zed copied to clipboard
editor: Fix git-hunk toggling for adjacent hunks
Closes #42934
Release Notes:
- Fix toggling adjacent git-diff hunks based on the reported behaviour in #42934
Commentary
- The command for toggling selected git-diff hunks as some complex behaviours depending on the position of the cursor, and whether there are multiple git-hunks near each other (separated by a line, or without a line separation).
- I've left some notes and recordings attached to issue #42934
- And this PR creates a failing test for one of the cases with adjacent hunks, however, we may want to add more tests and define the intended behaviour of the hunk-toggling command to avoid more regressions.
Here's a screen recording of the current behaviour with the changes in this PR:
https://github.com/user-attachments/assets/49abe418-cb21-4740-bd8a-a6798fbec50a