snailed
/
taolf
Archived
2
0
Fork 0

fix: not switching buffers on open

This commit is contained in:
Lucas Burns 2023-05-10 13:49:25 -05:00
parent 1b1c0426e6
commit aa72337c44
No known key found for this signature in database
GPG Key ID: C011CBEF6628B679
1 changed files with 6 additions and 13 deletions

View File

@ -262,7 +262,7 @@ end
---A callback for the `Terminal`
---
---@param term Terminal
function Lf:__callback(_term)
function Lf:__callback(term)
if self.cfg.tmux then
utils.tmux(false)
end
@ -277,18 +277,11 @@ function Lf:__callback(_term)
return
end
elseif uv.fs_stat(self.tmp_sel) then
local contents = {}
for line in io.lines(self.tmp_sel) do
table.insert(contents, line)
end
if #contents > 0 then
-- term:close()
for _, fname in pairs(contents) do
local stat = uv.fs_stat(fname)
if type(stat) == "table" then
cmd(("%s %s"):format(self.action, fn.fnameescape(fname)))
end
term:close()
for fname in io.lines(self.tmp_sel) do
local stat = uv.fs_stat(fname)
if type(stat) == "table" then
cmd(("%s %s"):format(self.action, fn.fnameescape(fname)))
end
end
end