mirror of
https://github.com/neovim/neovim.git
synced 2026-04-14 03:26: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.
(cherry picked from commit e508aa0fa8)
This commit is contained in:
committed by
github-actions[bot]
parent
b924afb36b
commit
d83141c0f2
@@ -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