harpoon.ui: use vim.loop.cwd() to avoid blocking the event loop

Prefer the async API for getting the cwd.
This commit is contained in:
David Aguilar 2022-02-03 15:52:44 -08:00
parent 627be003bf
commit cdb64582dc

View File

@ -164,7 +164,7 @@ function M.nav_file(id)
end
local mark = Marked.get_marked_file(idx)
local buf_id = vim.fn.bufnr(vim.fn.getcwd() .. "/" .. mark.filename, true)
local buf_id = vim.fn.bufnr(vim.api.cwd() .. "/" .. mark.filename, true)
local set_row = not vim.api.nvim_buf_is_loaded(buf_id)
vim.api.nvim_set_current_buf(buf_id)