aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/snapopen.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-01-19 23:09:24 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2011-01-19 23:09:24 -0500
commitbfe8c3cc714fd122b5945ddc83b9d27ca97e26fb (patch)
tree1fecefdf30e754580f3cf804031836e01fa3d1c7 /modules/textadept/snapopen.lua
parent98c6ba37e86c9ef6fe52c89e02462eb72a7ae790 (diff)
downloadtextadept-bfe8c3cc714fd122b5945ddc83b9d27ca97e26fb.tar.gz
textadept-bfe8c3cc714fd122b5945ddc83b9d27ca97e26fb.zip
Added gui.filteredlist() shortcut function for gui.dialog('filteredlist', ...).
Diffstat (limited to 'modules/textadept/snapopen.lua')
-rw-r--r--modules/textadept/snapopen.lua11
1 files changed, 2 insertions, 9 deletions
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