diff options
author | 2014-03-05 19:34:58 -0500 | |
---|---|---|
committer | 2014-03-05 19:34:58 -0500 | |
commit | 2cfe9977a692da7bfb4f87de453ee789ccda79e0 (patch) | |
tree | 41442566dd62dfd923a75b6b8de842c82fcd3a9d /core/ui.lua | |
parent | 79b26d84d36421274cd7d2c0fd956979d1319be0 (diff) | |
download | textadept-2cfe9977a692da7bfb4f87de453ee789ccda79e0.tar.gz textadept-2cfe9977a692da7bfb4f87de453ee789ccda79e0.zip |
Added support for gtdialog's new `optionselect` dialog.
This requires gtdialog r68 (changeset 1426c89d2874).
Diffstat (limited to 'core/ui.lua')
-rw-r--r-- | core/ui.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/ui.lua b/core/ui.lua index 744b09e8..5ae30b79 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -86,7 +86,12 @@ ui.dialogs = setmetatable({}, {__index = function(t, k) -- @return Lua objects depending on the dialog kind return function(options) if not options.button1 then options.button1 = _L['_OK'] end - if options.select then options.select = options.select - 1 end + local select = options.select + if type(select) == 'number' then + options.select = select - 1 + elseif type(select) == 'table' then + for i = 1, #select do select[i] = select[i] - 1 end + end -- Transform key-value pairs into command line arguments. local args = {} for option, value in pairs(options) do |