From a1a2d0f42eaec400cc6918a8e898fc1f9c4dbc5f Mon Sep 17 00:00:00 2001 From: bhagwan Date: Fri, 1 Dec 2023 10:14:31 -0800 Subject: [PATCH] fix(complete_path): relative parent with "../" (#941) --- lua/fzf-lua/complete.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/fzf-lua/complete.lua b/lua/fzf-lua/complete.lua index 77056ab1..4c86977f 100644 --- a/lua/fzf-lua/complete.lua +++ b/lua/fzf-lua/complete.lua @@ -23,7 +23,7 @@ local function find_toplevel_cwd(maybe_cwd, postfix, orig_cwd) if vim.fn.isdirectory(vim.fn.expand(maybe_cwd)) == 1 then local disp_cwd, cwd = maybe_cwd, vim.fn.expand(maybe_cwd) -- returned cwd must be full path - if cwd:sub(1, 1) == "." then + if cwd:sub(1, 1) == "." and cwd:sub(2, 2) == path.separator() then cwd = vim.loop.cwd() .. (#cwd > 1 and cwd:sub(2) or "") -- inject "./" only if original path started with it -- otherwise ignore the "." retval from fnamemodify