mirror of
https://github.com/kepler155c/opus
synced 2025-09-02 19:08:03 +00:00
alternative updates
This commit is contained in:
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user