From 5f29cb8190dbee6bb10b4eb904c8c39750de352d Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 23 Nov 2010 19:09:21 -0500 Subject: Code cleanup. Also modified the editing module's enclose() and select_enclosed() functions. --- modules/textadept/snapopen.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 modules/textadept/snapopen.lua (limited to 'modules/textadept/snapopen.lua') diff --git a/modules/textadept/snapopen.lua b/modules/textadept/snapopen.lua old mode 100755 new mode 100644 index f472b744..10690c75 --- a/modules/textadept/snapopen.lua +++ b/modules/textadept/snapopen.lua @@ -36,7 +36,7 @@ DEFAULT_DEPTH = 4 MAX = 1000 -- end settings -local lfs = require 'lfs' +local lfs_dir, lfs_attributes = lfs.dir, lfs.attributes local DEPTH = DEFAULT_DEPTH -- Determines whether or not the given file matches the given filter. @@ -64,10 +64,10 @@ end -- @param filter The filter table. local function add_directory(dir, list, depth, filter) local string_match, string_gsub, MAX = string.match, string.gsub, MAX - for file in lfs.dir(dir) do + for file in lfs_dir(dir) do if not string_match(file, '^%.%.?$') then file = dir..(not WIN32 and '/' or '\\')..file - if lfs.attributes(file).mode == 'directory' then + if lfs_attributes(file).mode == 'directory' then if not exclude(file, filter.folders) and depth < DEPTH then add_directory(file, list, depth + 1, filter) end -- cgit v1.2.3