mksession: named acwrite buffer saved as enew + :file instead of :edit (E95 with 'hidden', content not restored)
Maintainer thường phản hồi trong vòng 13 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start by reproducing with the two shell commands in the report, using --clean and a small acw.vim that sets a BufReadCmd for foo://*. Then find where :mksession writes the buffer restore step and why it emits enew plus :file for buftype=acwrite buffers instead of :edit. Done means the saved session sources without E95 under 'hidden' and the restored buffer re-reads its content through BufReadCmd.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Steps to reproduce
A named buftype=acwrite buffer (as used by plugins with BufReadCmd/BufWriteCmd, e.g. foo://bar) is written by :mksession as
badd +0 foo://bar
...
enew
file foo://bar
instead of edit foo://bar.
With 'hidden' set, sourcing the session while that buffer is still open fails with E95, because the original buffer stays loaded when enew runs:
" acw.vim
autocmd BufReadCmd foo://* call setline(1, 'content')
vim --clean -c 'set hidden' -c 'source acw.vim' -c 'e foo://bar' -c 'setlocal buftype=acwrite' -c 'mksession! s.vim' -c 'qa!'
vim --clean -c 'set hidden' -c 'source acw.vim' -c 'e foo://bar' -c 'setlocal buftype=acwrite' -c 'source s.vim'
Result:
E95: Buffer with this name already exists
:ls! then shows the original foo://bar buffer hidden and the current buffer as [No Name].
With 'nohidden' the original buffer is unloaded by enew, so :file takes over its name without E95. But the restored buffer is empty ("foo://bar" [Not edited] --No lines in buffer--), because enew + :file never triggers BufReadCmd.
This shows up in Neovim ('hidden' is on by default there), e.g. with :restart and plugins like oil.nvim (oil://). Originally reported at https://github.com/neovim/neovim/issues/42387.
Expected behaviour
The session restores the buffer with :edit foo://bar, which re-reads it via BufReadCmd and does not conflict with an already open buffer of the same name.
Version of Vim
9.1.1752 (macOS arm64)
Environment
macOS (Darwin 27.2.0), tmux, TERM=xterm-256color
Logs and stack traces
No response
- Ngôn ngữ chính
- Vim Script
- Star
- 41.4k
- Fork
- 6.2k
- 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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 vim/vim
-
autoconf failes to find libsodium even when present due to implicit function declarationCó thể đã có người làm @coderjoe đã nhận hôm nay. Đang mởbug
Độ 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 13 ngày
-
`json_decode()` uses a number as a string pointer when 'encoding' has no converterCó thể đã có người làm @mattn đã nhận 7 ngày trước. Đang mởbug
Độ 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 13 ngày
-
GTK4 build's v:servername is prefixed with $XDG_RUNTIME_DIR/vimCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 13 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 13 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
vim/vim#21204 · 14 bình luận ·
Maintainer thường phản hồi trong vòng 13 ngày
Issue tương tự
-
Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Shell completion for PowerShellĐang mởenhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
anthropics/skills#2328 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
tonydzi/sqlite-graph-memory#133 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: build-and-ci S3: minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
manaflow-ai/cmux#72257 ·
Maintainer thường phản hồi trong vòng 1 ngày