aboutsummaryrefslogtreecommitdiff
path: root/core/ext
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-02-15 23:58:21 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-02-15 23:58:21 -0500
commit5955540da3e0a8da20c6e627a5322b719103362e (patch)
tree909827a8d72d4b703b5e369f6f17ed22dac9b60c /core/ext
parent825f6a76c4c938f0978a9454b20e9ac502a246fc (diff)
downloadtextadept-5955540da3e0a8da20c6e627a5322b719103362e.tar.gz
textadept-5955540da3e0a8da20c6e627a5322b719103362e.zip
Cleaned up some Lua code.
Diffstat (limited to 'core/ext')
-rw-r--r--core/ext/find.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/ext/find.lua b/core/ext/find.lua
index d8fea666..bf72b833 100644
--- a/core/ext/find.lua
+++ b/core/ext/find.lua
@@ -4,6 +4,8 @@ local textadept = _G.textadept
local locale = _G.locale
local find = textadept.find
+local lfs = require 'lfs'
+
local MARK_FIND = 0
local MARK_FIND_COLOR = 0x4D9999
local previous_view
@@ -91,7 +93,6 @@ function find.find(text, next, flags, nowrap, wrapped)
if not find.lua then text = text:gsub('([().*+?^$%%[%]-])', '%%%1') end
if not find.match_case then text = text:lower() end
if find.whole_word then text = '[^%W_]'..text..'[^%W_]' end
- local lfs = require 'lfs'
local match_case = find.match_case
local whole_word = find.whole_word
local format = string.format
@@ -214,8 +215,8 @@ end
-- @see find.find
function find.replace_all(ftext, rtext, flags)
if #ftext == 0 then return end
- local buffer = buffer
if find.in_files then find.in_files = false end
+ local buffer = buffer
buffer:begin_undo_action()
local count = 0
if #buffer:get_sel_text() == 0 then