History

TOOLS/lua/autoload: don't shadow local variable

"dir" is already used somewhere above. This was ok, but not nice.

wm4 committed 12 years ago

Commit dd91c091 parent 3a7ecf61 file · +4 −4Browse files

Unified · Split

TOOLS/lua/autoload.lua+4−4
@@ -40,10 +40,10 @@ function find_and_add_entries() · 39 unmodified lines
40 return40 return
41 end41 end
42 local append = {[-1] = {}, [1] = {}}42 local append = {[-1] = {}, [1] = {}}
43 for dir = -1, 1, 2 do -- 2 iterations, with dir = -1 and +143 for direction = -1, 1, 2 do -- 2 iterations, with direction = -1 and +1
44 for i = 1, MAXENTRIES do44 for i = 1, MAXENTRIES do
45 local file = files[current + i * dir]45 local file = files[current + i * direction]
46 local pl_e = pl[pl_current + i * dir]46 local pl_e = pl[pl_current + i * direction]
47 if file == nil or file[1] == "." then47 if file == nil or file[1] == "." then
48 break48 break
49 end49 end
@@ -53,7 +53,7 @@ function find_and_add_entries() · 3 unmodified lines
53 break53 break
54 end54 end
55 end55 end
56 if dir == -1 then56 if direction == -1 then
57 if pl_current == 1 then -- never add additional entries in the middle57 if pl_current == 1 then -- never add additional entries in the middle
58 mp.msg.info("Prepending " .. file)58 mp.msg.info("Prepending " .. file)
59 table.insert(append[-1], 1, file)59 table.insert(append[-1], 1, file)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t