aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/editing.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-09-29 21:09:56 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-09-29 21:09:56 -0400
commit18d7be2d1eaaef73c56dc850a3172529726d7a34 (patch)
tree3eeffd78480b6ade940532e8dc3f143304b48cb6 /modules/textadept/editing.lua
parentef23e13ac57cf6a8bcb04ccce10d2e5b34feec06 (diff)
downloadtextadept-18d7be2d1eaaef73c56dc850a3172529726d7a34.tar.gz
textadept-18d7be2d1eaaef73c56dc850a3172529726d7a34.zip
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.
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r--modules/textadept/editing.lua13
1 files changed, 6 insertions, 7 deletions
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)