mirror of
https://github.com/neovim/neovim.git
synced 2026-06-16 00:31:16 +00:00
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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user