mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 02:34:10 +00:00
fix(ui2): allow empty argument for enable() #38605
Problem: `vim._core.ui2.enable` requires passing an empty table for default options, unlike other (native) Lua API. Solution: Initialize `opts` with empty table if `nil` is passed.
This commit is contained in:
@@ -168,6 +168,7 @@ local scheduled_ui_callback = vim.schedule_wrap(ui_callback)
|
||||
|
||||
---@nodoc
|
||||
function M.enable(opts)
|
||||
opts = opts or {}
|
||||
vim.validate('opts', opts, 'table', true)
|
||||
M.cfg = vim.tbl_deep_extend('keep', opts, M.cfg)
|
||||
M.cfg.msg.target = type(M.cfg.msg.targets) == 'string' and M.cfg.msg.targets or M.cfg.msg.target
|
||||
|
||||
Reference in New Issue
Block a user