-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-cycler1.lua
More file actions
36 lines (30 loc) · 738 Bytes
/
config-cycler1.lua
File metadata and controls
36 lines (30 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
inspect = require("inspect/inspect")
local sidebar_width = 30
local args = { ... }
sidebar_width = args[1]
print("sidebar_width = " .. sidebar_width)
function cycler(name, ...)
print("---------------------------------------")
local args = { ... }
-- if not config[name] then
-- print("Unknown config option: " .. tostring(name))
-- return
-- end
print(#args)
local match = -1
for i, v in ipairs(args) do
print(i, v)
if tostring(sidebar_width) == tostring(v) then
print("match")
match = i - 1
break
end
end
print(match)
match = ((match + 1) % #args) + 1
print()
print(match)
print("---------------------------------------")
print(name .. " = " .. args[match])
end
cycler("sidebar_width", 10, 20, 30)