"dir" is already used somewhere above. This was ok, but not nice.
Unified · Split
| @@ -40,10 +40,10 @@ function find_and_add_entries() · 39 unmodified lines | ||
| 40 | 40 | return |
| 41 | 41 | end |
| 42 | 42 | local append = {[-1] = {}, [1] = {}} |
| 43 | − for dir = -1, 1, 2 do -- 2 iterations, with dir = -1 and +1 | |
| 43 | + for direction = -1, 1, 2 do -- 2 iterations, with direction = -1 and +1 | |
| 44 | 44 | for i = 1, MAXENTRIES do |
| 45 | − local file = files[current + i * dir] | |
| 46 | − local pl_e = pl[pl_current + i * dir] | |
| 45 | + local file = files[current + i * direction] | |
| 46 | + local pl_e = pl[pl_current + i * direction] | |
| 47 | 47 | if file == nil or file[1] == "." then |
| 48 | 48 | break |
| 49 | 49 | end |
| @@ -53,7 +53,7 @@ function find_and_add_entries() · 3 unmodified lines | ||
| 53 | 53 | break |
| 54 | 54 | end |
| 55 | 55 | end |
| 56 | − if dir == -1 then | |
| 56 | + if direction == -1 then | |
| 57 | 57 | if pl_current == 1 then -- never add additional entries in the middle |
| 58 | 58 | mp.msg.info("Prepending " .. file) |
| 59 | 59 | table.insert(append[-1], 1, file) |