mirror of
https://github.com/kepler155c/opus
synced 2024-12-31 19:00:27 +00:00
alternative updates
This commit is contained in:
parent
340e37da82
commit
4a6af34d7c
@ -1,3 +1,4 @@
|
||||
local Array = require('opus.array')
|
||||
local Config = require('opus.config')
|
||||
local Util = require('opus.util')
|
||||
|
||||
@ -33,10 +34,22 @@ end
|
||||
function Alt.set(key, value)
|
||||
local config = getConfig()
|
||||
|
||||
Alt.addChoice(key, value)
|
||||
|
||||
config.default[key] = value
|
||||
Config.update('alternate', config)
|
||||
end
|
||||
|
||||
function Alt.remove(key, value)
|
||||
local config = getConfig()
|
||||
|
||||
Array.removeByValue(config.choices[key], value)
|
||||
if config.default[key] == value then
|
||||
config.default[key] = config.choices[key][1]
|
||||
end
|
||||
Config.update('alternate', config)
|
||||
end
|
||||
|
||||
function Alt.addChoice(key, value)
|
||||
local config = getConfig()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user