fix(ui2): error E518 when typing "vim:" in cmdline #39599

Problem: `vim:`, etc. in cmdline are interpreted as modeline, causing error E518.

Solution: Set 'nomodeline' when creating the buffers.
(cherry picked from commit 0ea720f281)
This commit is contained in:
STG
2026-05-06 21:43:01 +09:00
committed by github-actions[bot]
parent 0aa77cb78c
commit 13041a067e

View File

@@ -84,7 +84,11 @@ function M.check_targets()
local win = api.nvim_win_is_valid(M.wins[type]) and M.wins[type]
local floating = win and api.nvim_win_get_config(win).zindex
local setopt = not buf or not win or not floating
M.bufs[type] = buf or api.nvim_create_buf(false, false)
M.bufs[type] = buf
or (function(b)
vim.bo[b].modeline = false
return b
end)(api.nvim_create_buf(false, false))
if not win or not floating then
-- Open a new window when closed or no longer floating (e.g. wincmd J).