aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-02-26 11:20:02 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2020-02-26 11:20:02 -0500
commitf26af5cde434cb4825d254d2d507de898ec77d77 (patch)
treed3b4293f8e4e476b9d39a24f44ab1a717b05c650
parent0e07b7478899600805c32564f1b88c1aaedbe16f (diff)
downloadtextadept-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.lua6
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})