From 320c2bcd10ecbcd1780f58754005d4d03ed82d77 Mon Sep 17 00:00:00 2001 From: Bryan Date: Mon, 16 Sep 2024 23:10:16 -0600 Subject: [PATCH] Change behavour so that if there is no parent directory matching the pattern for a project then the current directory will be the project root --- lua/cd-project/api.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/cd-project/api.lua b/lua/cd-project/api.lua index d1f6ba5..863f45f 100644 --- a/lua/cd-project/api.lua +++ b/lua/cd-project/api.lua @@ -10,7 +10,8 @@ local function find_project_dir() ) if #found == 0 then - return vim.loop.os_homedir() + -- if there are no parent directories matching the project pattern then use current directory as project directory + return vim.fn.getcwd() end local project_dir = vim.fs.dirname(found[1])