From ac698c5ea71d26e56289a18e664c6f8be1aa56c5 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 10 Jan 2009 17:31:21 -0500 Subject: 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. --- modules/textadept/macros.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/textadept/macros.lua') 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 mitchellcaladbolg.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]) -- cgit v1.2.3