From 7fcf5435513590d59bd2666a04c820be4c51e97e Mon Sep 17 00:00:00 2001 From: Peter Kosyh Date: Mon, 2 Oct 2023 01:47:48 +0300 Subject: [PATCH] red: grep path fix --- data/lib/red/proc.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/data/lib/red/proc.lua b/data/lib/red/proc.lua index 155747f..0ed5311 100644 --- a/data/lib/red/proc.lua +++ b/data/lib/red/proc.lua @@ -108,11 +108,10 @@ end function proc.grep(w, rex) if not rex then return end - local path = w:data() and w:data():path() + local path = w:data() and w:data():path() or + sys.dirname(w.frame:getfilename()) w = w:output('+grep') - w:run(function() - grep(sys.dirname(path or w.frame:getfilename()), rex, w) - end) + w:run(function() grep(path, rex, w) end) end --luacheck: push