From 18d7be2d1eaaef73c56dc850a3172529726d7a34 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 29 Sep 2013 21:09:56 -0400 Subject: Added new `ui.dialogs` module for more user-friendly dialog support. As a result, removed `ui.filteredlist()` and changed `io.open_file()` and `io.snapopen()` APIs to accept tables of files and paths instead of "\n" delimited strings. --- modules/textadept/editing.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'modules/textadept/editing.lua') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 1fd74e07..ac703fe2 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -307,13 +307,12 @@ end -- @name goto_line function M.goto_line(line) if not line then - line = tonumber(ui.dialog('inputbox', - '--title', _L['Go To'], - '--text', _L['Line Number:'], - '--button1', _L['_OK'], - '--button2', _L['_Cancel'], - '--no-newline'):match('%-?%d+$')) - if not line or line < 0 then return end + local button, value = ui.dialogs.inputbox{ + title = _L['Go To'], informative_text = _L['Line Number:'], + button1 = _L['_OK'], button2 = _L['_Cancel'] + } + line = tonumber(value) + if button ~= 1 or not line then return end end buffer:ensure_visible_enforce_policy(line - 1) buffer:goto_line(line - 1) -- cgit v1.2.3