diff options
author | 2020-02-26 11:20:02 -0500 | |
---|---|---|
committer | 2020-02-26 11:20:02 -0500 | |
commit | f26af5cde434cb4825d254d2d507de898ec77d77 (patch) | |
tree | d3b4293f8e4e476b9d39a24f44ab1a717b05c650 | |
parent | 0e07b7478899600805c32564f1b88c1aaedbe16f (diff) | |
download | textadept-f26af5cde434cb4825d254d2d507de898ec77d77.tar.gz textadept-f26af5cde434cb4825d254d2d507de898ec77d77.zip |
Fixed bugs in return values for standard_dropdown and msgbox dialogs.
standard_dropdown was not returning the right value and msgboxes could not
return string output.
-rw-r--r-- | core/ui.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/ui.lua b/core/ui.lua index c7d8dd40..88dd83c6 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -159,10 +159,12 @@ ui.dialogs = setmetatable({}, {__index = function(_, k) elseif not options.string_output then local i, value = result:match('^(%-?%d+)\n?(.*)$') i = tonumber(i) - if k == 'dropdown' then value = i > 0 and tonumber(value) + 1 or nil end + if k:find('dropdown') then + value = i > 0 and tonumber(value) + 1 or nil + end return i, value end - return result:match('([^\n]+)\n(.*)$') + return result:match('([^\n]+)\n?(.*)$') end end}) |