Skip to content

fix(commands): allow history from active diff buffers - #552

Merged
yanuoma merged 1 commit into
mainfrom
fix/issue-463-visual-line-history-in-diff
Sep 6, 2026
Merged

fix(commands): allow history from active diff buffers#552
yanuoma merged 1 commit into
mainfrom
fix/issue-463-visual-line-history-in-diff

Conversation

@esmuellert

Copy link
Copy Markdown
Owner

Summary

  • keep the argument-less :CodeDiff command as the session close toggle
  • dispatch subcommands such as :CodeDiff history even when the current tab already contains a diff session
  • add an end-to-end regression test for '<,'>CodeDiff history from an inline diff buffer

Fix

Previously, commands.vscode_diff() closed any active CodeDiff session before parsing the command arguments. As a result, visual line history issued from an active diff buffer never reached the history handler.

The toggle now applies only when there are no arguments. Active diff buffers can invoke history and other explicit CodeDiff subcommands normally.

Closes #463

Testing

  • CODEDIFF_TEST_JOBS=2 make test-lua — 106 spec files passed
  • stylua --check lua/codediff/commands/init.lua tests/command_e2e_spec.lua
  • git diff --check

Keep the CodeDiff toggle behavior for an argument-less invocation, but dispatch subcommands while a diff session is active. This lets visual line history create its history session instead of closing the current diff.

Closes #463
@yanuoma
yanuoma merged commit 99eb4fb into main Sep 6, 2026
19 of 20 checks passed
@yanuoma
yanuoma deleted the fix/issue-463-visual-line-history-in-diff branch September 6, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Visual Line History does not work inside codediff buffers

2 participants