1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 01:52:19 +00:00

lua: unbreak mp.add_key_binding(key, fn)

Commit 311cc5b6 added the ability use flags while omitting name, but
broke the case where both name and flags are omitted.

Now omitting either name or flags or both works as documented.
This commit is contained in:
Avi Halachmi (:avih) 2019-11-30 11:56:21 +02:00 committed by avih
parent 2750ca597c
commit abf6b22abd

View File

@ -156,12 +156,12 @@ local function update_key_bindings()
end
local function add_binding(attrs, key, name, fn, rp)
rp = rp or ""
if (type(name) ~= "string") and (name ~= nil) then
rp = fn
fn = name
name = nil
end
rp = rp or ""
if name == nil then
name = reserve_binding()
end