aboutsummaryrefslogtreecommitdiff
path: root/core/ui.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/ui.lua')
-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})