diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0ee8c012..2537c1f1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.4.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index b44cd6c9..1ba587fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,22 +2,47 @@ ## [Unreleased] -### Features - -- `User ClaudeCodeSendComplete` autocmd, fired once per file when a send is accepted while Claude is connected, with `data = { file_path, start_line, end_line, context }` (lines 0-indexed). Lets you run arbitrary post-send logic — in particular, focus a Claude session running outside Neovim (`provider = "none"`/`"external"`), e.g. via `tmux select-pane`, which `focus_after_send` cannot do. ([#228](https://github.com/coder/claudecode.nvim/issues/228)) -- `:ClaudeCodeCloseAllDiffs` command to close pending Claude diffs at once (e.g. proposals orphaned by resolving them via Claude remote control). Diffs you have already accepted but whose file has not been written yet are left intact so saved edits are never discarded. ([#248](https://github.com/coder/claudecode.nvim/issues/248)) -- `:ClaudeCodeSendText {text}` command (and `require("claudecode.terminal").send_to_terminal(text, opts)` function) to send arbitrary text to the open Claude terminal as if typed at the prompt, submitting it by default. `:ClaudeCodeSendText!` inserts the text without submitting. Handy for scripting and keymaps; multi-line text is sent via bracketed paste. Works with the in-editor `native`/`snacks` providers only — `external`/`none` run Claude outside Neovim, where there is no pane to write to. ([#197](https://github.com/coder/claudecode.nvim/issues/197)) - -### Bug Fixes - -- The Claude terminal now adds the loopback hosts (`localhost`, `127.0.0.1`, `::1`) to `no_proxy`/`NO_PROXY`, so a configured `http_proxy`/`all_proxy` no longer tunnels Claude's `ws://127.0.0.1` IDE connection and causes queued @ mentions to time out. Existing `no_proxy` exclusions are preserved. ([#70](https://github.com/coder/claudecode.nvim/issues/70)) -- `focus_after_send = true` no longer fails silently with `terminal.provider = "none"`/`"external"`: those providers run Claude outside Neovim, so focus cannot move there. A one-time warning is now emitted at setup pointing to the new `User ClaudeCodeSendComplete` autocmd, which you can hook to focus your own terminal. (`focus_after_send` still only auto-focuses the in-editor providers.) ([#228](https://github.com/coder/claudecode.nvim/issues/228)) -- Rejecting a Claude diff with `:q` (or `:close` / `c` / closing the tab) now resolves it as rejected, matching the documented behavior. The proposed buffer is a scratch buffer that `:q` only hides, so the existing `BufDelete`/`BufUnload`/`BufWipeout` autocmds never fired; a `WinClosed` autocmd now handles window-close rejection. ([#238](https://github.com/coder/claudecode.nvim/issues/238)) -- Push quickly-made visual selections to Claude reliably. Selections made and released faster than the selection-tracking debounce were never broadcast, and any selection was wiped shortly after leaving visual mode when Claude runs in an external terminal (the `/ide` flow) — so single-line selections in particular often never reached Claude. Selections are now flushed synchronously on visual-mode exit (from the `'<`/`'>` marks) and persist until the cursor actually moves; a single-line linewise `V` made right after a charwise selection is also no longer mis-extracted to a single character. ([#246](https://github.com/coder/claudecode.nvim/issues/246)) -- Diffs opened via `openDiff` no longer linger forever when they are resolved outside this Neovim or their Claude session goes away. Pending diffs are now automatically closed when the client that opened them disconnects or the integration is stopped, and `closeAllDiffTabs` now also resolves/cleans the diff module's tracked state instead of only closing windows. ([#248](https://github.com/coder/claudecode.nvim/issues/248)) -- Show diffs when the Claude Code terminal is the only window (no other splits). Previously `openDiff` failed with "No suitable editor window found"; now a split is created to host the diff, matching the behavior of the `openFile` tool. ([#231](https://github.com/coder/claudecode.nvim/issues/231)) -- Fix the "climbing cursor" in the Snacks terminal: hiding and re-showing the Claude panel no longer leaves the cursor one row above the prompt (so typed text lands on the wrong line). The Snacks provider now hides/shows without destroying the window — floats are parked via `nvim_win_set_config({hide=...})` and splits are recreated like the native provider — which preserves the cursor anchor Claude re-renders against on focus-in. Splits are fixed on all supported Neovim versions; the float fix requires Neovim >= 0.10. ([#240](https://github.com/coder/claudecode.nvim/issues/240), [#183](https://github.com/coder/claudecode.nvim/issues/183)) -- Work around a Neovim core bug (< 0.12.2) that fragmented large bracketed pastes into the terminal across `vim.paste` phases, making Cmd+V appear to truncate content. Added a scoped, version-gated `vim.paste` shim controlled by `terminal.fix_streamed_paste` (`"auto"` by default; no-op on Neovim >= 0.12.2). ([#161](https://github.com/coder/claudecode.nvim/issues/161)) +## [0.4.0] - 2026-06-15 + +### Added + +- `:ClaudeCodeSendText {text}` command (and `require("claudecode.terminal").send_to_terminal(text, opts)`) to send arbitrary text to the open Claude terminal as if typed at the prompt, submitting by default; `:ClaudeCodeSendText!` inserts without submitting. Multi-line text uses bracketed paste. Works with the in-editor `native`/`snacks` providers only ([#272](https://github.com/coder/claudecode.nvim/pull/272), [#197](https://github.com/coder/claudecode.nvim/issues/197)). +- `User ClaudeCodeSendComplete` autocmd, fired once per file when a send is accepted while Claude is connected, with `data = { file_path, start_line, end_line, context }` (lines 0-indexed). Lets you focus a Claude session running outside Neovim (`provider = "none"`/`"external"`), e.g. via `tmux select-pane`, which `focus_after_send` cannot do ([#265](https://github.com/coder/claudecode.nvim/pull/265), [#228](https://github.com/coder/claudecode.nvim/issues/228)). +- `User ClaudeCodeDiffOpened` / `ClaudeCodeDiffClosed` autocmds carrying diff metadata so configs can react to diffs opening and closing (resize, relayout, statusline, etc.) ([#270](https://github.com/coder/claudecode.nvim/pull/270)). +- `terminal.diff_split_width_percentage` to set a separate Claude terminal width while a diff is open (falls back to `split_width_percentage` when unset), and `diff_opts.auto_resize_terminal` (default `true`) to opt out of automatic width management entirely ([#270](https://github.com/coder/claudecode.nvim/pull/270)). +- `:ClaudeCodeCloseAllDiffs` command to close pending Claude diffs at once. Diffs already accepted but not yet written are left intact ([#261](https://github.com/coder/claudecode.nvim/pull/261), [#248](https://github.com/coder/claudecode.nvim/issues/248)). +- `:checkhealth claudecode` health check that verifies Neovim version, `setup()`, Claude CLI resolution, terminal provider sanity, the WebSocket server/port, the IDE lock file, and live connection state ([#275](https://github.com/coder/claudecode.nvim/pull/275)). +- netrw file selection support: `as` in a netrw buffer adds marked files or the file under the cursor to Claude's context ([#62](https://github.com/coder/claudecode.nvim/pull/62)). +- snacks.nvim picker support for `:ClaudeCodeTreeAdd` / `:ClaudeCodeSend`, adding selected files from `Snacks.explorer()` and `Snacks.picker` to Claude's context ([#269](https://github.com/coder/claudecode.nvim/pull/269), [#192](https://github.com/coder/claudecode.nvim/issues/192)). +- Model picker labels are now version-free (`Claude Opus (Latest)`, etc.) with new 1M-context aliases (`opus[1m]`, `sonnet[1m]`) and a `Default (account recommended)` entry ([#256](https://github.com/coder/claudecode.nvim/pull/256)). + +### Fixed + +- WebSocket server now retries port binding on `EADDRINUSE`, so a second Neovim instance no longer fails to start with "Failed to listen on port ... address already in use" ([#284](https://github.com/coder/claudecode.nvim/pull/284), [#283](https://github.com/coder/claudecode.nvim/issues/283)). +- Detect system sleep/wake and reset client keepalive timestamps, preventing false disconnections after a laptop resumes from sleep ([#141](https://github.com/coder/claudecode.nvim/pull/141)). +- IDE auth token is now generated from a CSPRNG (`vim.loop.random`) and the lock file is written atomically with `0600` permissions in a `0700` directory (previously world-readable) ([#259](https://github.com/coder/claudecode.nvim/pull/259)). +- Close the connection on malformed WebSocket frames with the proper RFC 6455 close code instead of stalling forever with un-drained buffer bytes ([#258](https://github.com/coder/claudecode.nvim/pull/258), [#257](https://github.com/coder/claudecode.nvim/issues/257)). +- `on_disconnect` now fires on all teardown paths (EOF, read/protocol errors, keepalive timeout), fixing "phantom" client entries that accumulated over time ([#176](https://github.com/coder/claudecode.nvim/pull/176), [#170](https://github.com/coder/claudecode.nvim/issues/170)). +- IDE diagnostics tool no longer errors when Claude passes a bare file path instead of a `file://` URI ([#163](https://github.com/coder/claudecode.nvim/pull/163)). +- IDE tool responses now return grouped URI-based diagnostics with editor-native ranges and severity names, stop advertising an unsupported resources capability, and harden background file opens ([#274](https://github.com/coder/claudecode.nvim/pull/274)). +- Legacy `diff_opts.vertical_split` and `open_in_current_tab` are honored again; they were silently ignored due to merge ordering ([#142](https://github.com/coder/claudecode.nvim/pull/142)). +- `keep_terminal_focus = true` now works for floating Claude terminals (e.g. Snacks `position = "float"`), which previously lost focus to the diff split ([#178](https://github.com/coder/claudecode.nvim/pull/178), [#150](https://github.com/coder/claudecode.nvim/issues/150)). +- Diffs now open when the Claude terminal is the only window; previously this failed with "No suitable editor window found" ([#260](https://github.com/coder/claudecode.nvim/pull/260), [#231](https://github.com/coder/claudecode.nvim/issues/231)). +- Rejecting a diff with `:q` (or `:close` / `c` / tab close) now resolves it as rejected via a new `WinClosed` autocmd, matching the documented behavior ([#266](https://github.com/coder/claudecode.nvim/pull/266), [#238](https://github.com/coder/claudecode.nvim/issues/238)). +- Pending diffs are now auto-closed when the client that opened them disconnects or the server stops, instead of lingering when resolved outside this Neovim ([#261](https://github.com/coder/claudecode.nvim/pull/261), [#248](https://github.com/coder/claudecode.nvim/issues/248)). +- Plugin-created diff splits are now closed on cleanup, so accepted/rejected diffs no longer leave stray windows behind ([#175](https://github.com/coder/claudecode.nvim/pull/175), [#155](https://github.com/coder/claudecode.nvim/issues/155)). +- With `open_in_new_tab = true`, a stranded empty tab is no longer left behind (and focus returns to the original tab) when diff setup errors ([#264](https://github.com/coder/claudecode.nvim/pull/264), [#262](https://github.com/coder/claudecode.nvim/issues/262)). +- Snacks Explorer and picker windows are excluded from main-editor-window detection, so diffs no longer open on top of or corrupt the explorer/picker sidebar ([#255](https://github.com/coder/claudecode.nvim/pull/255), [#165](https://github.com/coder/claudecode.nvim/pull/165)). +- Quickly-made visual selections are now pushed to Claude reliably: selections are flushed synchronously on visual-mode exit and persist until the cursor moves, fixing single-line selections that often never reached Claude ([#267](https://github.com/coder/claudecode.nvim/pull/267), [#246](https://github.com/coder/claudecode.nvim/issues/246)). +- Selection context is now also sent on `BufEnter`, so switching buffers without moving the cursor updates Claude ([#159](https://github.com/coder/claudecode.nvim/pull/159)). +- Selection-context fallback for external terminals (`provider = "none"`) now matches the Claude buffer name by substring, fixing skipped/incorrect context detection ([#160](https://github.com/coder/claudecode.nvim/pull/160)). +- The Snacks terminal no longer leaves a "climbing cursor" after hide/show toggles; the panel is parked and restored without being destroyed ([#271](https://github.com/coder/claudecode.nvim/pull/271), [#240](https://github.com/coder/claudecode.nvim/issues/240), [#183](https://github.com/coder/claudecode.nvim/issues/183)). +- Loopback hosts (`localhost`, `127.0.0.1`, `::1`) are added to `no_proxy`/`NO_PROXY` for the Claude terminal so a configured proxy no longer tunnels Claude's `ws://127.0.0.1` IDE connection and times out @ mentions ([#268](https://github.com/coder/claudecode.nvim/pull/268), [#70](https://github.com/coder/claudecode.nvim/issues/70)). +- The 1M-context model aliases (`opus[1m]`, `sonnet[1m]`) launched via the Snacks provider no longer fail with a shell glob error; the launch command is now passed as an argv list ([#256](https://github.com/coder/claudecode.nvim/pull/256)). +- Work around a Neovim core bug (< 0.12.2) that fragmented large bracketed pastes into the terminal; gated by `terminal.fix_streamed_paste` (`"auto"` by default) ([#252](https://github.com/coder/claudecode.nvim/pull/252)). +- Debounce timers in selection tracking are now stopped and closed correctly, fixing a libuv handle leak and stale callbacks firing after being superseded ([#245](https://github.com/coder/claudecode.nvim/pull/245)). +- `focus_after_send = true` now emits a one-time warning under `provider = "none"`/`"external"` (which run Claude outside Neovim) pointing to `User ClaudeCodeSendComplete` ([#265](https://github.com/coder/claudecode.nvim/pull/265), [#228](https://github.com/coder/claudecode.nvim/issues/228)). +- Updated the latest Claude Haiku model version ([#146](https://github.com/coder/claudecode.nvim/pull/146)). ## [0.3.0] - 2025-09-15 diff --git a/VERSION b/VERSION index 0d91a54c..1d0ba9ea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0 +0.4.0