From 59711857128387b6c9c40368157ce686151983d1 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 6 Nov 2014 13:45:18 -0500 Subject: Fixed return values from `ui.dialogs.optionselect()`; core/ui.lua --- core/ui.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'core/ui.lua') diff --git a/core/ui.lua b/core/ui.lua index 24a5cbaf..28c7cef0 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -117,11 +117,13 @@ ui.dialogs = setmetatable({}, {__index = function(t, k) local files = {} for file in result:gmatch('[^\n]+') do files[#files + 1] = file end return files - elseif k == 'filteredlist' or + elseif k == 'filteredlist' or k == 'optionselect' or k:find('input') and result:match('^[^\n]+\n?(.*)$'):find('\n') then local button, value = result:match('^([^\n]+)\n?(.*)$') if not options.string_output then button = tonumber(button) end - if k:find('input') then + if k == 'optionselect' then + options.select_multiple = true + elseif k:find('input') then options.string_output, options.select_multiple = true, true end local items, patt = {}, not k:find('input') and '[^\n]+' or '([^\n]*)\n' @@ -164,7 +166,8 @@ end -- to show the requested file. If *split* is `false`, shifts to the next or -- *preferred_view* view in order to show the requested file. If *sloppy* is -- `true`, requires only the last part of *filename* to match a buffer's --- `filename`. +-- `filename`. If the requested file was not found, it is opened in the desired +-- view. -- @param filename The filename of the buffer to go to. -- @param split Optional flag that indicates whether or not to open the buffer -- in a split view if there is only one view. The default value is `false`. -- cgit v1.2.3