mirror of
https://github.com/neovim/neovim.git
synced 2026-10-25 23:20:23 -05: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:
1 parent
0aa77cb78c
commit
13041a067e
1 file changed
+5
-1
@@ -84,7 +84,11 @@ function M.check_targets()
|
|||||||
local win = api.nvim_win_is_valid(M.wins[type]) and M.wins[type]
|
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 floating = win and api.nvim_win_get_config(win).zindex
|
||||||
local setopt = not buf or not win or not floating
|
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
|
if not win or not floating then
|
||||||
-- Open a new window when closed or no longer floating (e.g. wincmd J).
|
-- Open a new window when closed or no longer floating (e.g. wincmd J).
|
||||||
|
|||||||
Reference in new issue
Block a user