diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-01-26 19:35:43 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-01-26 19:35:43 +0100 |
commit | 43fc66771a0c9d27cc0b7fe7a69392ea313bd0ca (patch) | |
tree | 9b339c63cd28528e5062fe980e964808df619374 /scripts/context/lua/mtx-grep.lua | |
parent | 5189b2143a30a39cd3533569cbef3f06422cc1d9 (diff) | |
download | context-43fc66771a0c9d27cc0b7fe7a69392ea313bd0ca.tar.gz |
2020-01-26 18:37:00
Diffstat (limited to 'scripts/context/lua/mtx-grep.lua')
-rw-r--r-- | scripts/context/lua/mtx-grep.lua | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/context/lua/mtx-grep.lua b/scripts/context/lua/mtx-grep.lua index 9a4237737..e4a2a8d2f 100644 --- a/scripts/context/lua/mtx-grep.lua +++ b/scripts/context/lua/mtx-grep.lua @@ -173,15 +173,17 @@ function scripts.grep.find(pattern, files, offset) local globbed = dir.glob(files[i]) for i=1,#globbed do name = globbed[i] - local data = io.loaddata(name) - if data then - n, m, noffiles = 0, 0, noffiles + 1 - lpegmatch(capture,data) - if count and m > 0 then - nofmatches = nofmatches + m - nofmatchedfiles = nofmatchedfiles + 1 - write_nl(format("%5i %s",m,name)) - io.flush() + if not find(name,"/%.") then + local data = io.loaddata(name) + if data then + n, m, noffiles = 0, 0, noffiles + 1 + lpegmatch(capture,data) + if count and m > 0 then + nofmatches = nofmatches + m + nofmatchedfiles = nofmatchedfiles + 1 + write_nl(format("%5i %s",m,name)) + io.flush() + end end end end |