From e672ee07c4b97fa205db0a5c75f69d9f8310eaac Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 4 Mar 2008 22:05:52 -0500 Subject: Fixed bugs with tonumber(cocoa_dialog(...)) in various files. Instead of the extra overhead when calling tonumber(), add the --no-newline option and do a direct string comparison. --- modules/textadept/editing.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 1a06bae7..d032356d 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -223,9 +223,9 @@ function goto_line(line) title = 'Go To', text = 'Line Number:', ['no-newline'] = true - } ):match('%d+$') - if not line and line > -1 then return end - line = tonumber(line) + } ) + if line == '-1' then return end + line = tonumber( line:match('%d+$') ) end buffer:ensure_visible_enforce_policy(line - 1) buffer:goto_line(line - 1) -- cgit v1.2.3