Skip to content

[BUG] Somehow my UI for the diff preview is glitches #236

Closed

Description

@edwardtran1561

Bug Description

When claude code ask me to edit a file, the preview ui in my neovim somehow is glitch.

To Reproduce

Steps to reproduce the behavior:

  1. cd to a work directory, then run nvim
  2. open a file, ac to open claude code pane
  3. Tell claude code to edit something

Expected Behavior

The split pane of preview diff should show the right position

Environment

  • Neovim version: 0.11.6
  • Claude Code CLI version: 2.1.84
  • OS: MacOS Tahoe 26.3.1
  • Plugin version: Latest

Additional findings

The bug only occurs when using Snacks Explorer (LazyVim default).
Switching to neo-tree resolves the issue completely.

This suggests claudecode.nvim does not properly detect snacks_explorer
window type when deciding where to open the diff split.

Expected: diff should open in the editor window, not the explorer window

Screen.Recording.2026-04-06.at.18.29.10.mov

Activity

  1. edwardtran1561 commented on Apr 19, 2026

    @edwardtran1561
    Author

    Hey, just checking in — has this been resolved yet? Still running into the same issue on my end. Thanks!

  2. zhecks commented on May 12, 2026

    @zhecks

    has this been resolved?I have same problem. Thanks!

  3. edwardtran1561 commented on May 14, 2026

    @edwardtran1561
    Author

    has this been resolved?I have same problem. Thanks!

    Hi @zhecks , you can try to add this config, i tried and it's worked fine

    return {
    	"coder/claudecode.nvim",
    	opts = {
    		diff_opts = {
    			open_in_new_tab = true,
    		},
    	},
    	keys = {
    		{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
    		{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
    		{ "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Focus Claude" },
    		{ "<leader>ar", "<cmd>ClaudeCode --resume<cr>", desc = "Resume Claude" },
    		{ "<leader>aC", "<cmd>ClaudeCode --continue<cr>", desc = "Continue Claude" },
    		{ "<leader>ab", "<cmd>ClaudeCodeAdd %<cr>", desc = "Add current buffer" },
    		{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send to Claude" },
    		{
    			"<leader>as",
    			"<cmd>ClaudeCodeTreeAdd<cr>",
    			desc = "Add file",
    			ft = { "NvimTree", "neo-tree", "oil" },
    		},
    		-- Diff management
    		{ "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" },
    		{ "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Deny diff" },
    	},
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions