From bfe8c3cc714fd122b5945ddc83b9d27ca97e26fb Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 19 Jan 2011 23:09:24 -0500 Subject: Added gui.filteredlist() shortcut function for gui.dialog('filteredlist', ...). --- modules/textadept/snapopen.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'modules/textadept/snapopen.lua') diff --git a/modules/textadept/snapopen.lua b/modules/textadept/snapopen.lua index 3661f4b6..3f27c9f0 100644 --- a/modules/textadept/snapopen.lua +++ b/modules/textadept/snapopen.lua @@ -114,13 +114,6 @@ function open(paths, filter, exclusive, depth) L('files or more were found. Showing the first'), MAX)) end - local out = gui.dialog('filteredlist', - '--title', L('Open'), - '--button1', 'gtk-ok', - '--button2', 'gtk-cancel', - '--no-newline', - '--columns', 'File', - '--items', list) - local response, index = out:match('^(%d+)[\r\n]+(%d+)') - if response == '1' then io.open_file(list[tonumber(index) + 1]) end + local i = gui.filteredlist(L('Open'), 'File', list, true) + if i then io.open_file(list[i + 1]) end end -- cgit v1.2.3