Repository navigation
fix(diff): open a new-tab diff on Neovim 0.8, which has no 'statuscolumn' - #394
Conversation
With `diff_opts.open_in_new_tab` and a Claude terminal window, openDiff copies the terminal window's options into the new tab. Neovim 0.8 has no 'statuscolumn', so the copy fails with "unknown option 'statuscolumn'" and openDiff answers -32000. This real-Neovim spec fails on Neovim 0.8.3 and passes on 0.12.3. _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
The user's :w answers FILE_SAVED, and Claude's close_tab closes the new tab and keeps the user's terminal window. Without the fix this fails on Neovim 0.8.3 too, at openDiff. _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
…umn' With `diff_opts.open_in_new_tab` and a Claude terminal window, openDiff copies the terminal window's options into the new tab. Reading 'statuscolumn' raised "unknown option" on Neovim 0.8, where that option does not exist (it is new in 0.9), so openDiff failed with -32000. Read it only on Neovim 0.9 and later. Setting it already goes through pcall. Part of #393. _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
main's record (#394) now covers diff.lua. Only server/client.lua and server/frame.lua differ from it, as in the earlier records on this branch, and check.sh passes. Part of #393 _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
…, #397, #399 check.sh --mutants caught every guard on the tree merged with #394. This merge changes no fact (all 21 read TRUE) and not the model, so the mutant result holds. check.sh passes. _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
Part of #393 (item 1).
Why
The goal is to close the open follow-up issues in this repo, which list bugs found while verifying earlier fixes. This PR covers item 1 of issue 393. It breaks a Neovim version the README supports (0.8 and later).
With
diff_opts.open_in_new_tab = trueand a Claude terminal window open, every openDiff failed on Neovim 0.8. Claude got-32000 Diff setup failed ... unknown option 'statuscolumn', and the user got the error and aPress ENTERprompt. The new-tab path copies the terminal window's options into the new tab (capture_window_options, added in #111). It read'statuscolumn', which Neovim 0.8 does not have (the option is new in 0.9).What changed
capture_window_optionsinlua/claudecode/diff.luareads'statuscolumn'only whenhas("nvim-0.9").apply_window_optionsalready sets each option throughpcall, so the default options'statuscolumn = ""needs no change.tests/integration/diff_new_tab_spec.lua. It opens a diff in a new tab while a real terminal buffer has a window. It checks that the terminal shows in the new tab with its window options. It also checks that the user's:wanswersFILE_SAVED, and that Claude'sclose_tabcloses the tab and keeps the terminal window.covered.lockis re-recorded, because thediff.luafile hash changed. No covered block or fact changed.Scope
Only the option copy on Neovim 0.8. I checked the rest of the new-tab lifecycle on 0.8.3 (open,
:w,close_tab) live and in the spec, and it works once the copy works.Blast Radius
Neovim 0.9 and later read the same options as before. On 0.8 the new tab's terminal window keeps its own
'statuscolumn', which 0.8 does not have anyway. Nothing else callscapture_window_options.Verification
Red first: the new spec fails 2 of 2 on Neovim 0.8.3 without the fix, with
diff.lua:280: unknown option 'statuscolumn'. With the fix it passes 2 of 2 on 0.8.3, 0.9.5 and 0.12.3. CI's integration job runs it on v0.8.0 and stable.Live runs through the
verify-claudecode-nvimharness, with a real Claude terminal (native provider runningsh) andopen_in_new_tab = true. For 0.8.3 I used a scratch copy of the harness that takes the Neovim binary from an env var, and that allows a server that is its own TUI process (Neovim 0.8 has no separate TUI process).:wclose_tab-32000 ... unknown option 'statuscolumn',Press ENTERpromptFILE_SAVEDTAB_CLOSED, 1 tab, 2 windowsFILE_SAVEDTAB_CLOSED, 1 tab, 2 windowsNeovim 0.8.3 on main:
Neovim 0.8.3 with this PR:
Gates on the head:
mise run check(0 warnings),mise run test(952 passed, shuffled),./scripts/run_integration_tests_individually.sh(32 passed), stylua clean..agents/skills/verify-diff-lifecycle/check.shpasses.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh