diff options
author | 2009-01-10 17:31:21 -0500 | |
---|---|---|
committer | 2009-01-10 17:31:21 -0500 | |
commit | ac698c5ea71d26e56289a18e664c6f8be1aa56c5 (patch) | |
tree | e683366e29ff29e8c0ebff54731ff505c201a6ff /modules/textadept/macros.lua | |
parent | 0194a626fcb17bcb037341fc6c2f586f54d26035 (diff) | |
download | textadept-ac698c5ea71d26e56289a18e664c6f8be1aa56c5.tar.gz textadept-ac698c5ea71d26e56289a18e664c6f8be1aa56c5.zip |
Various improvements to speed and readability of Lua code.
Added 'local textadept = _G.textadept' to all Lua modules, themes, etc.
Added more locals to core/ext/keys.lua for speed improvement.
Reformatted some Lua modules to the earlier standard committed.
Diffstat (limited to 'modules/textadept/macros.lua')
-rw-r--r-- | modules/textadept/macros.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/textadept/macros.lua b/modules/textadept/macros.lua index 978a3482..62f9f972 100644 --- a/modules/textadept/macros.lua +++ b/modules/textadept/macros.lua @@ -1,5 +1,7 @@ -- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE. +local textadept = _G.textadept + --- -- Support for recording, saving, and playing macros for the textadept module. -- @@ -63,7 +65,7 @@ function stop_recording() if not recording then return end buffer:stop_record() recording = false - local textadept, locale = textadept, textadept.locale + local locale = textadept.locale local ret, macro_name = cocoa_dialog('standard-inputbox', { ['informative-text'] = locale.M_TEXTADEPT_MACRO_SAVE_TITLE, @@ -117,7 +119,8 @@ function play(macro_name) end local macro = list[macro_name] if not macro then return end - local buffer, bf = buffer, textadept.buffer_functions + local buffer = buffer + local bf = textadept.buffer_functions for _, command in ipairs(macro) do local cmd, wParam, lParam = unpack(command) local _, _, p1_type, p2_type = unpack(bf[cmd]) |