aboutsummaryrefslogtreecommitdiff
path: root/core/ext/find.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-01-10 17:31:21 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-01-10 17:31:21 -0500
commitac698c5ea71d26e56289a18e664c6f8be1aa56c5 (patch)
treee683366e29ff29e8c0ebff54731ff505c201a6ff /core/ext/find.lua
parent0194a626fcb17bcb037341fc6c2f586f54d26035 (diff)
downloadtextadept-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 'core/ext/find.lua')
-rw-r--r--core/ext/find.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/ext/find.lua b/core/ext/find.lua
index 5def64e8..e036934f 100644
--- a/core/ext/find.lua
+++ b/core/ext/find.lua
@@ -1,5 +1,6 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+local textadept = _G.textadept
local find = textadept.find
---
@@ -25,7 +26,7 @@ local escapes = {
-- for displaying useful statusbar information. This flag is used and set
-- internally, and should not be set otherwise.
function find.find(text, next, flags, nowrap, wrapped)
- local buffer, textadept = buffer, textadept
+ local buffer = buffer
local increment, result
text = text:gsub('\\[abfnrtv\\]', escapes)
find.captures = nil
@@ -135,7 +136,6 @@ end
-- @param flags The number mask identical to the one in 'find'.
-- @see find.find
function find.replace_all(ftext, rtext, flags)
- local textadept = textadept
buffer:goto_pos(0)
local count = 0
while(find.find(ftext, true, flags, true)) do