diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/args.lua | 4 | ||||
-rw-r--r-- | core/events.lua | 8 | ||||
-rw-r--r-- | core/file_io.lua | 4 | ||||
-rw-r--r-- | core/gui.lua | 6 | ||||
-rw-r--r-- | core/init.lua | 2 | ||||
-rw-r--r-- | core/keys.lua | 12 |
6 files changed, 18 insertions, 18 deletions
diff --git a/core/args.lua b/core/args.lua index 173ef914..f59a52cd 100644 --- a/core/args.lua +++ b/core/args.lua @@ -56,9 +56,9 @@ end -- Shows all registered command line switches in a help dialog. local function show_help() - _G.print('Usage: textadept [args] [filenames]') + print('Usage: textadept [args] [filenames]') local line = " %s [%d args]: %s" - for k, v in pairs(switches) do _G.print(line:format(k, unpack(v, 2))) end + for k, v in pairs(switches) do print(line:format(k, unpack(v, 2))) end os.exit() end register('-h', '--help', 0, show_help, 'Displays this') diff --git a/core/events.lua b/core/events.lua index 022ccad1..6b8ac99b 100644 --- a/core/events.lua +++ b/core/events.lua @@ -1,6 +1,6 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize +local L = locale.localize --- -- Textadept's core event structure and handlers. @@ -132,9 +132,9 @@ module('events', package.seeall) -- * `find_text`: The text to search for. -- * `repl_text`: The text to replace found text with. -- * `RESET_AFTER`: Called after resetting the Lua state. This is triggered by --- `_G.reset()`. +-- `reset()`. -- * `RESET_BEFORE`: Called before resetting the Lua state. This is triggered by --- `_G.reset()`. +-- `reset()`. -- * `SAVE_POINT_LEFT`: Called when a save point is left. -- * `SAVE_POINT_REACHED`: Called when a save point is entered. -- * `UPDATE_UI`: Called when either the text or styling of the buffer has @@ -211,7 +211,7 @@ function emit(event, ...) if not event then error(L('Undefined event name')) end local h = handlers[event] if not h then return end - local pcall, unpack, type = _G.pcall, _G.unpack, _G.type + local pcall, unpack, type = pcall, unpack, type for i = 1, #h do local ok, result = pcall(h[i], unpack{...}) if not ok then diff --git a/core/file_io.lua b/core/file_io.lua index 016b66da..c7ca424f 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -1,7 +1,7 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize -local events = _G.events +local L = locale.localize +local events = events --- -- Extends Lua's io package to provide file input/output routines for Textadept. diff --git a/core/gui.lua b/core/gui.lua index 36c25165..24a68de9 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -1,7 +1,7 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize -local gui = _G.gui +local L = locale.localize +local gui = gui -- LuaDoc is in core/.gui.luadoc. function gui.check_focused_buffer(buffer) @@ -87,7 +87,7 @@ function gui.switch_buffer() if i then view:goto_buffer(i + 1, true) end end -local connect = _G.events.connect +local connect = events.connect -- Sets default properties for a Scintilla window. connect(events.VIEW_NEW, function() diff --git a/core/init.lua b/core/init.lua index f5eb769c..8bebca32 100644 --- a/core/init.lua +++ b/core/init.lua @@ -29,7 +29,7 @@ if not _THEME:find('[/\\]') then end -- LuaDoc is in core/._G.luadoc. -function _G.user_dofile(filename) +function user_dofile(filename) if not lfs.attributes(_USERHOME..'/'..filename) then return false end local ok, err = pcall(dofile, _USERHOME..'/'..filename) if not ok then gui.print(err) end diff --git a/core/keys.lua b/core/keys.lua index bdd146ad..1fe62b17 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -1,6 +1,6 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize +local L = locale.localize --- -- Manages key commands in Textadept. @@ -92,12 +92,12 @@ local ALT = 'a'..ADD -- end settings -- Optimize for speed. -local string = _G.string +local string = string local string_char = string.char -local xpcall = _G.xpcall -local next = _G.next -local type = _G.type -local unpack = _G.unpack +local xpcall = xpcall +local next = next +local type = type +local unpack = unpack local no_args = {} local getmetatable = getmetatable local error = function(e) events.emit(events.ERROR, e) end |