[BUG] Re-shown snacks split puts the cursor a row above the prompt when it has a winbar
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- lua, neovim
- Lĩnh vực
- cli, developer-experience, tooling
Hướng nghiên cứu
Bắt đầu trong lua/claudecode/terminal/snacks.lua và kiểm tra chuỗi hiển thị lại xung quanh vsplit, nvim_win_set_buf và reapply_snacks_window_state. Tái hiện chu kỳ ẩn/hiện với provider snacks mặc định và một winbar. Hoàn thành khi trạng thái được áp dụng lại trước khi chuyển buffer và việc chuyển đổi lặp lại vẫn giữ prompt cùng con trỏ của Claude thẳng hàng mà không làm mất winbar.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Re-showing the split terminal with the snacks provider still leaves the cursor a row above Claude's ❯ prompt, the symptom in #240, whenever the split has a winbar. That's the default for split terminals (snacks/terminal.lua sets N: %{get(b:, 'term_title', '')} unless wo.winbar is set), and neither claudecode nor LazyVim's claudecode extra overrides it, so it's what you get out of the box.
To reproduce, open Claude in a right split with the default snacks provider, hide it with :ClaudeCode, show it again with :ClaudeCode, and the cursor sits a row above the prompt.
The re-show in lua/claudecode/terminal/snacks.lua runs vsplit, then nvim_win_set_buf, then reapply_snacks_window_state. Until the options are reapplied the terminal sits in a window with no winbar, one row taller than Claude last drew into. Neovim pulls a line of scrollback onto the screen when a terminal grows, and when the winbar comes back it drops a blank row off the bottom instead of pushing that line back, so the content ends up a row lower than Claude thinks it is. Claude redraws relative to the cursor, so every frame after that is a row off.
Moving reapply_snacks_window_state(term, new_win) above nvim_win_set_buf fixes it for me. The winbar survives the buffer switch, and hide/show stayed aligned in every case I tried, four quick toggles in a row included, with no Ctrl+L sent. Setting snacks_win_opts.wo.winbar = "" also works, but loses the title.
- Neovim 0.12.5
- Claude Code 2.1.283
- claudecode.nvim 2390c6e (current main)
- snacks.nvim 882c996
- WSL2 Ubuntu
- Ngôn ngữ chính
- Lua
- Star
- 3.1k
- Fork
- 217
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/claudecode.nvim
-
bug needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
coder/claudecode.nvim#314 ·
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
coder/claudecode.nvim#313 ·
-
Is this plugin abondonned?Đang mởneeds-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
coder/claudecode.nvim#319 · 1 reaction ·
-
[BUG] 框选文本一直抱错误信息Đang mởbug needs-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
coder/claudecode.nvim#316 · 1 bình luận ·
-
needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
coder/claudecode.nvim#309 ·
Tất cả issue của coder/claudecode.nvim
Issue tương tự
-
Unconfirmed bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
luanti-org/luanti#17605 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
agent-in-progress agent-research-recommend enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
codymikol/multiverse.nvim#337 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nickjvandyke/opencode.nvim#336 ·
-
Bug Forever Module - Quest Needs testing/reproduction
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày