aboutsummaryrefslogtreecommitdiff
path: root/files.lua
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-02 15:17:48 -0700
committerBruce Hill <bruce@bruce-hill.com>2018-11-02 15:17:49 -0700
commit0f17c5eb9ac4660f2f969bd1e67af42713e45eac (patch)
tree279ca7da2de0efe2f363684f3c84a540635f11a8 /files.lua
parentacd9c2acd4688f2301b091daad910c04e402bd6a (diff)
parentdc41f30c73c9686685e3a4183c1213fb4ba55c90 (diff)
Merge branch 'master' into working
Diffstat (limited to 'files.lua')
-rw-r--r--files.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/files.lua b/files.lua
index c04f703..13679e3 100644
--- a/files.lua
+++ b/files.lua
@@ -181,6 +181,8 @@ Files.walk = function(path, flush_cache)
files = {
path
}
+ elseif path:match("^[~/]") or path:match("^%./") or path:match("^%.%./") then
+ files = browse(path)
else
for nomsupath in package.nomsupath:gmatch("[^;]+") do
do
@@ -191,20 +193,18 @@ Files.walk = function(path, flush_cache)
end
end
end
- local iter
- iter = function(files, i)
- if not (files) then
- return
- end
- i = i + 1
- do
- local f = files[i]
- if f then
- return i, f
- end
+ files = files or { }
+ do
+ local _accum_0 = { }
+ local _len_0 = 1
+ for _index_0 = 1, #files do
+ local f = files[_index_0]
+ _accum_0[_len_0] = gsub(f, "^%./", "")
+ _len_0 = _len_0 + 1
end
+ files = _accum_0
end
- return iter, files, 0
+ return ipairs(files)
end
local line_counter = re.compile([[ lines <- {| line (%nl line)* |}
line <- {} (!%nl .)*