diff: add a true in-place "inline" overlay (virtual text) as the future layout = "inline"
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 45/100
調査の方向性
まず現在の layout = "unified" の経路を追跡し、#293、#195、#169、#277、#205 で参照されているネイティブの diff 動作と比較します。単一バッファの extmark ビュー、編集可能な追加行、仮想的な削除行、承認/拒否の動作、および ClaudeCodeDiffOpened / ClaudeCodeDiffClosed autocmd の処理を定義します。完了の条件は、提案する inline モードが追加のウィンドウなしで動作し、レビュー時の編集を保持することです。
索引モデルが issue の本文から書いたものです。
説明
Summary
Follow-up to #293 / #195. The diff_opts.layout = "unified" option (renamed from "inline" before v0.4.0) renders a unified diff in a separate vsplit pane — a single read-only buffer with interleaved red/green lines. This issue tracks adding a true in-place inline overlay: the diff shown as virtual text layered onto the file in the same window, the way users typically picture a "VS Code-style inline" diff (cf. mini.diff, gitsigns preview, sidekick NES, Cursor inline edits).
When implemented, this mode is the one that should claim layout = "inline" — which is exactly why we reserved that name in #293.
"unified" vs the proposed "inline"
"unified"(shipped): single read-only buffer in arightbelow vsplit, deleted (red/strikethrough) + added (green) lines interleaved. Compact, but it's a separate pane and not editable before accept."inline"(this issue): no extra window — proposed changes rendered in place over the real file.
Suggested approach (keeps pre-accept editability)
The unified/read-only path forfeits editing the proposal before accepting. A prototype pattern that keeps it (the codecompanion/sidekick model):
- Proposed/added lines = real, editable buffer lines, highlighted (e.g.
ClaudeCodeInlineDiffAdd) with a+sign. - Deleted lines = virtual text via
nvim_buf_set_extmarkvirt_lines(strikethrough/red), so they're visible but not part of the editable content. - On accept, the buffer content already is the new file (deleted lines were never real text), so edits made during review are captured. On reject, clear the extmarks / restore.
A pure-Lua, zero-dependency engine (not mini.diff/diffview — see #169) keeps this aligned with the project's philosophy. Bonus: a single-buffer extmark view sets no &diff windows, which sidesteps the closeAllDiffTabs foreign-diff class (#277) and the stale-diff repaint issues (#205).
Notes
- The current
"unified"path doesn't fire theClaudeCodeDiffOpened/ClaudeCodeDiffClosedUserautocmds that the native diff does — worth wiring up for any new mode. - @wookayin expressed interest ("once we implement that") on #195 — collaboration welcome.
Refs #293, #195, #82
🤖 Generated with Claude Code
- 主要言語
- Lua
- スター
- 3.1k
- フォーク
- 217
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/claudecode.nvim のほかの issue
-
bug needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
coder/claudecode.nvim#314 ·
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/claudecode.nvim#313 ·
-
needs-triage
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
coder/claudecode.nvim#319 · リアクション 1 件 ·
-
[BUG] 框选文本一直抱错误信息 オープンbug needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
coder/claudecode.nvim#316 · コメント 1 件 ·
-
needs-triage
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
coder/claudecode.nvim#309 ·
coder/claudecode.nvim の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
openSUSE/python-rpm-macros#219 ·
-
bug mini.bracketed
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
accessibility bug typst
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
quarto-dev/quarto-cli#14947 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
HenrikBengtsson/CBI-software#134 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
secondlife/slua#96 ·