From d83141c0f2d27b11d235877e3ca910881d417ce6 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 30 Mar 2026 18:47:02 +0200 Subject: [PATCH] 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 e508aa0fa8366550a1b97f0c977960bf723a8b81) --- runtime/lua/vim/_core/ui2.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/lua/vim/_core/ui2.lua b/runtime/lua/vim/_core/ui2.lua index 82c9b2ab0c..77ea7f57b3 100644 --- a/runtime/lua/vim/_core/ui2.lua +++ b/runtime/lua/vim/_core/ui2.lua @@ -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