This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Neovim plugin written in Lua providing inline diff functionality.
Run tests (requires plenary.nvim):
nvim --headless -u tests/minimal_init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal_init.lua'}" -c "qa"Run a single test file:
nvim --headless -u tests/minimal_init.lua -c "PlenaryBustedFile tests/path_to_spec.lua" -c "qa"Lint with luacheck:
luacheck lua/Format with stylua:
stylua lua/Standard Neovim plugin layout:
lua/inline-diff/
init.lua # Public API: setup(), enable(), disable(), toggle()
diff.lua # Diff engine: Myers line diff + word diff, git HEAD retrieval
highlight.lua # Derive InlineDiff* highlight groups from DiffAdd/DiffDelete
render.lua # Apply extmarks (line highlights, virt_lines, inline virt_text)
state.lua # Per-buffer state: namespace, augroup, debounce timer, edge-virt flags, ref cache
plugin/
inline-diff.lua # Auto-loaded: registers InlineDiffEnable/Disable/Toggle(InlineDiff) commands
tests/
minimal_init.lua # Minimal Neovim config bootstrapping plenary
*_spec.lua # Test files (plenary busted)
- Requires Neovim 0.11+ (uses
virt_text_pos = "inline"andvim.uv). - Internals are exposed as
M._*for unit testing. - Word-level colors are derived at runtime by shifting the HSL lightness and saturation of
DiffAdd/DiffDelete. Groups are re-derived onColorScheme. - Deleted lines render as
virt_lines. - Live updates are debounced (default 150 ms) via a reused
vim.uvtimer per buffer. - Tests use plenary's
busted-compatible API (describe,it,assert).