Showing the changes to player/lua/defaults.lua (1 of 1 file). Show all
Unified · Split
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | -- Compatibility shim for lua 5.2/5.3 |
| 2 | −unpack = unpack or table.unpack | |
| 2 | +-- luacheck: globals unpack | |
| 3 | +unpack = unpack or table.unpack -- luacheck: globals table.unpack | |
| 3 | 4 | |
| 4 | 5 | -- these are used internally by lua.c |
| 5 | 6 | mp.UNKNOWN_TYPE.info = "this value is inserted if the C type is not supported" |
| @@ -95,7 +96,7 @@ function mp.set_key_bindings(list, section, flags) · 89 unmodified lines | ||
| 95 | 96 | local cb_up = entry[4] |
| 96 | 97 | if type(cb) ~= "string" then |
| 97 | 98 | local mangle = reserve_binding() |
| 98 | − dispatch_key_bindings[mangle] = function(name, state) | |
| 99 | + dispatch_key_bindings[mangle] = function(_, state) | |
| 99 | 100 | local event = state:sub(1, 1) |
| 100 | 101 | local is_mouse = state:sub(2, 2) == "m" |
| 101 | 102 | local def = (is_mouse and "u") or "d" |
| @@ -156,7 +157,7 @@ function mp.flush_keybindings() · 54 unmodified lines | ||
| 156 | 157 | flags = "force" |
| 157 | 158 | end |
| 158 | 159 | local bindings = {} |
| 159 | − for k, v in pairs(key_bindings) do | |
| 160 | + for _, v in pairs(key_bindings) do | |
| 160 | 161 | if v.bind and v.forced ~= def then |
| 161 | 162 | bindings[#bindings + 1] = v |
| 162 | 163 | end |
| @@ -199,7 +200,7 @@ local function add_binding(attrs, key, name, fn, rp) · 36 unmodified lines | ||
| 199 | 200 | ["r"] = "repeat", |
| 200 | 201 | ["p"] = "press", |
| 201 | 202 | } |
| 202 | − key_cb = function(name, state, key_name, key_text) | |
| 203 | + key_cb = function(_, state, key_name, key_text) | |
| 203 | 204 | if key_text == "" then |
| 204 | 205 | key_text = nil |
| 205 | 206 | end |
| @@ -214,7 +215,7 @@ local function add_binding(attrs, key, name, fn, rp) · 8 unmodified lines | ||
| 214 | 215 | fn({event = "press", is_mouse = false}) |
| 215 | 216 | end |
| 216 | 217 | else |
| 217 | − key_cb = function(name, state) | |
| 218 | + key_cb = function(_, state) | |
| 218 | 219 | -- Emulate the same semantics as input.c uses for most bindings: |
| 219 | 220 | -- For keyboard, "down" runs the command, "up" does nothing; |
| 220 | 221 | -- for mouse, "down" does nothing, "up" runs the command. |
| @@ -428,7 +429,7 @@ end · 207 unmodified lines | ||
| 428 | 429 | function mp.unregister_event(cb) |
| 429 | 430 | for name, sub in pairs(event_handlers) do |
| 430 | 431 | local found = false |
| 431 | − for i, e in ipairs(sub) do | |
| 432 | + for _, e in ipairs(sub) do | |
| 432 | 433 | if e == cb then |
| 433 | 434 | found = true |
| 434 | 435 | break |