From 5955540da3e0a8da20c6e627a5322b719103362e Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 15 Feb 2009 23:58:21 -0500 Subject: Cleaned up some Lua code. --- core/ext/find.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/ext/find.lua') 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 -- cgit v1.2.3