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:
parent
2750ca597c
commit
abf6b22abd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user