code-preview.nvim
code-preview.nvim copied to clipboard
A Neovim plugin that shows a live diff preview of AI coding agent's file edits before you accept or reject them.
Closes #55. ## What Renames the path-like parameters threaded through `lua/code-preview/diff.lua` so their names match what they actually hold: | Old | New | Meaning | |-----|-----|---------| | `real_file_path` |...
## Summary When an agent proposes changes to **multiple files**, the plugin opens **one diff per tab**. Because neo-tree is **tab-scoped** in Neovim, switching between those diff tabs lands you...
Opening the real existing file as current would allow the user to navigate the code via LSP and use the syntax highlighting too.
Dynamically choosing the neovim instance would be nice. Also an option to prefer the current neovim instance over other instances when Open-Code is running inside neovim would be nice
If an edit is rejected, the diff preview in nvim should disappear automatically.
Hi! I'm running my Claude Code inside a container. Is there a way to wire it up with Neovim, running on a host machine? Thanks!
## Motivation `lua/code-preview/diff.lua` `show_diff(original_path, proposed_path, real_file_path, abs_file_path, action)` takes four path-like parameters whose names have drifted. Two are misleading: - `real_file_path` is **not** the real path — it's the *display*...
## Motivation The inline renderer in `lua/code-preview/diff.lua` highlights which *characters within a changed line* differ between the original and proposed content (extmarks with `ClaudeDiffInlineAddedText` / `ClaudeDiffInlineRemovedText` priority 200, layered on...
## Motivation `lua/code-preview/diff.lua` contains `mark_change_and_reveal`, which: - Sets a status in `code-preview.changes` registry. - Calls `code-preview.neo_tree.refresh()`. - Computes a reveal target (falling back to nearest existing ancestor for `created` files)....
## Motivation `lua/code-preview/diff.lua` is 599 lines covering four loosely related concerns: 1. The side-by-side renderer (`show_diff` after the `layout == "inline"` branch). 2. The inline renderer (`show_inline_diff`, `build_inline_diff`, `char_diff_ranges`, `inline_statuscolumn`,...