Skip to content

Commit 2078f50

Browse files
committed
fix(fixtures): avoid treesitter injection errors in repro config
Change-Id: I812c397919e884b243e275c1c1a519254d57893e Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent fc643c4 commit 2078f50

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

fixtures/repro/init.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ end
6363
-- Keymaps (kept small on purpose)
6464
vim.keymap.set("n", "<leader>ac", function()
6565
if ensure_claudecode_started() then
66-
vim.cmd("ClaudeCode")
66+
local terminal = require("claudecode.terminal")
67+
terminal.simple_toggle({}, nil)
6768
end
6869
end, { desc = "Toggle Claude" })
6970

7071
vim.keymap.set("n", "<leader>af", function()
7172
if ensure_claudecode_started() then
72-
vim.cmd("ClaudeCodeFocus")
73+
local terminal = require("claudecode.terminal")
74+
terminal.focus_toggle({}, nil)
7375
end
7476
end, { desc = "Focus Claude" })
7577

@@ -80,7 +82,12 @@ vim.keymap.set("n", "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", { desc = "Deny
8082
-- Convenience helpers for iterating on this fixture.
8183
vim.api.nvim_create_user_command("ReproEditConfig", function()
8284
local config_path = vim.fn.stdpath("config") .. "/init.lua"
83-
vim.cmd("edit " .. vim.fn.fnameescape(config_path))
85+
86+
-- Open the config file without `:edit` / `vim.cmd(...)` so we don't trigger
87+
-- Treesitter "vim" language injections (which can be noisy if parsers/queries mismatch).
88+
local bufnr = vim.fn.bufadd(config_path)
89+
vim.fn.bufload(bufnr)
90+
vim.api.nvim_set_current_buf(bufnr)
8491
end, { desc = "Edit the repro Neovim config" })
8592

8693
vim.keymap.set("n", "<leader>ae", "<cmd>ReproEditConfig<cr>", { desc = "Edit repro config" })

0 commit comments

Comments
 (0)