aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2008-03-04 22:05:52 -0500
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2008-03-04 22:05:52 -0500
commite672ee07c4b97fa205db0a5c75f69d9f8310eaac (patch)
tree9a026d4edd3c840b49c2b2c79115d143285903f1 /modules
parent4187ba40e77ee91ae99b6fb6356cced2eb717d7e (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua6
1 files changed, 3 insertions, 3 deletions
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)