Skip to content

Commit da78309

Browse files
authored
Merge pull request #41 from coder/fix/unified-diff-acceptance-behavior
1 parent 4bebd0e commit da78309

File tree

4 files changed

+169
-319
lines changed

4 files changed

+169
-319
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,35 @@ The `:ClaudeCodeAdd` command allows you to add files or directories directly by
130130
- **Validation**: Checks that files and directories exist before adding, validates line numbers
131131
- **Flexible**: Works with both individual files and entire directories
132132

133+
## Working with Diffs
134+
135+
When Claude proposes changes to your files, the plugin opens a native Neovim diff view showing the original file alongside the proposed changes. You have several options to accept or reject these changes:
136+
137+
### Accepting Changes
138+
139+
- **`:w` (save)** - Accept the changes and apply them to your file
140+
- **`<leader>da`** - Accept the changes using the dedicated keymap
141+
142+
You can edit the proposed changes in the right-hand diff buffer before accepting them. This allows you to modify Claude's suggestions or make additional tweaks before applying the final version to your file.
143+
144+
Both methods signal Claude Code to apply the changes to your file, after which the plugin automatically reloads the affected buffers to show the updated content.
145+
146+
### Rejecting Changes
147+
148+
- **`:q` or `:close`** - Close the diff view to reject the changes
149+
- **`<leader>dq`** - Reject changes using the dedicated keymap
150+
- **`:bdelete` or `:bwipeout`** - Delete the diff buffer to reject changes
151+
152+
When you reject changes, the diff view closes and the original file remains unchanged.
153+
154+
### Accepting/Rejecting from Claude Code Terminal
155+
156+
You can also navigate to the Claude Code terminal window and accept or reject diffs directly from within Claude's interface. This provides an alternative way to manage diffs without using the Neovim-specific keymaps.
157+
158+
### How It Works
159+
160+
The plugin uses a signal-based approach where accepting or rejecting a diff sends a message to Claude Code rather than directly modifying files. This ensures consistency and allows Claude Code to handle the actual file operations while the plugin manages the user interface and buffer reloading.
161+
133162
#### Examples
134163

135164
```vim

0 commit comments

Comments
 (0)