snailed
/
taolf
Archived
2
0
Fork 0

update: use vim.fs module

This commit is contained in:
Lucas Burns 2022-07-08 10:15:38 -05:00
parent f8a224ab0f
commit 03e4274350
No known key found for this signature in database
GPG Key ID: C011CBEF6628B679
1 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,7 @@ end
local api = vim.api
local fn = vim.fn
local fs = vim.fs
local uv = vim.loop
local o = vim.o
local map = utils.map
@ -261,17 +262,19 @@ function Lf:__on_open(term)
-- local curr_file = api.nvim_buf_get_name(fn.bufnr("#"))
if self.cfg.focus_on_open and term.dir == fn.fnamemodify(self.curr_file, ":h") then
if self.cfg.focus_on_open and term.dir == fs.dirname(self.curr_file) then
local f = assert(io.open(self.id_tmpfile, "r"))
local data = f:read("*a")
f:close()
local base = fs.basename(self.curr_file)
Job:new(
{
command = "lf",
args = {
"-remote",
("send %d select %s"):format(tonumber(data), fn.fnamemodify(self.curr_file, ":t"))
("send %d select %s"):format(tonumber(data), base)
},
interactive = false,
detached = true,