Skip to content

Commit

Permalink
feat: the path given to yazi is not ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
barona-mika-vilpas committed Feb 26, 2024
1 parent d241fbd commit 5226589
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lua/yazi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,24 @@ local function on_exit(job_id, code, event)
end

--- :Yazi entry point
---@param path string? defaults to the current file or the working directory
function M.yazi(path)
if utils.is_yazi_available() ~= true then
print('Please install yazi. Check documentation for more information')
return
end

if path == '' or path == nil then
path = vim.fn.expand('%:p')
end
if path == '' or path == nil then
path = vim.fn.expand('%:p:h')
end
if path == '' or path == nil then
vim.fn.expand('%:p')
end

prev_win = vim.api.nvim_get_current_win()
path = vim.fn.expand('%:p:h')

win, buffer = window.open_floating_window()

Expand Down

0 comments on commit 5226589

Please sign in to comment.